Skip to content

Commit

Permalink
fix(search): handle keyboard enter key as search button
Browse files Browse the repository at this point in the history
Close #135
  • Loading branch information
stantanasi committed Jul 19, 2024
1 parent ad9d732 commit 106faab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ class SearchMobileFragment : Fragment() {
binding.etSearch.apply {
setOnEditorActionListener { _, actionId, _ ->
when (actionId) {
EditorInfo.IME_ACTION_SEARCH -> {
EditorInfo.IME_ACTION_GO,
EditorInfo.IME_ACTION_SEARCH,
EditorInfo.IME_ACTION_SEND,
EditorInfo.IME_ACTION_NEXT,
EditorInfo.IME_ACTION_DONE -> {
viewModel.search(text.toString())
hideKeyboard()
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ class SearchTvFragment : Fragment() {
binding.etSearch.apply {
setOnEditorActionListener { _, actionId, _ ->
when (actionId) {
EditorInfo.IME_ACTION_SEARCH -> {
EditorInfo.IME_ACTION_GO,
EditorInfo.IME_ACTION_SEARCH,
EditorInfo.IME_ACTION_SEND,
EditorInfo.IME_ACTION_NEXT,
EditorInfo.IME_ACTION_DONE -> {
viewModel.search(text.toString())
hideKeyboard()
true
Expand Down

0 comments on commit 106faab

Please sign in to comment.