mirror of
https://github.com/cranci1/Sora.git
synced 2026-05-07 10:40:26 +00:00
add debounce to searchBar
This commit is contained in:
parent
6640a8a4b7
commit
78865f9330
1 changed files with 1 additions and 1 deletions
|
|
@ -325,7 +325,7 @@ struct SearchBar: View {
|
|||
.onChange(of: text){newValue in
|
||||
debounceTimer?.invalidate()
|
||||
// Start a new timer to wait before performing the action
|
||||
debounceTimer = Timer.scheduledTimer(withTimeInterval: 0.25, repeats: false) { _ in
|
||||
debounceTimer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { _ in
|
||||
// Perform the action after the delay (debouncing)
|
||||
onSearchButtonClicked()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue