I use TextField as a search box. When the user types in some text, the app performs a search in the DB. I hope not to have an extra "search" button, the app should just search as the user types, but hopefully not on every single stroke, better only when the user pauses typing. How can I do it?
Is it possible to perform some action after input on TextField?
1.9k views Asked by LXJ At
1
I'm assuming that you're using Kotlin Flow, but you can do almost the same thing if you use RxJava. Basically, what you need is the
debounce
operator in your flow.You can achieve the desired result doing the following:
Finally, in your composable, you can do: