Skip to content

Commit

Permalink
fix omnibar taking focus when hiding keyboard (#5069)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1202552961248957/1208407851630430/f

### Description
After we did #5033 the omnibar is taking focus more than usual, triggering onFocus changes in some unexpected scenarios (e.g: if we send the app to background, etc.)

After taking a look, the logic to show/hide keyboard was changed, and we now, for both methods, execute `editText.requestFocus()`. That seems correct for showing, but unsure for hiding. 

### Steps to test this PR

_Feature 1_
- just smoke test

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
  • Loading branch information
cmonfortep authored Sep 26, 2024
1 parent ee97869 commit 7256354
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,5 @@ fun Activity.showKeyboard(editText: EditText) {
}

fun Activity.hideKeyboard(editText: EditText) {
editText.requestFocus()
WindowInsetsControllerCompat(window, editText).hide(WindowInsetsCompat.Type.ime())
}

0 comments on commit 7256354

Please sign in to comment.