Skip to content

Commit

Permalink
Merge pull request #2114 from Infomaniak/fix-recipient-chip
Browse files Browse the repository at this point in the history
fix: Remove onFocusChange in BackspaceAwareChip because we only need focusableInTouchMode in xml for accessibility
  • Loading branch information
tevincent authored Nov 26, 2024
2 parents 95b23e1 + 7540d86 commit ec06534
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package com.infomaniak.mail.ui.newMessage

import android.content.Context
import android.graphics.Rect
import android.util.AttributeSet
import android.view.KeyEvent
import com.google.android.material.chip.Chip
Expand All @@ -30,15 +29,6 @@ class BackspaceAwareChip @JvmOverloads constructor(

private var onBackspace: () -> Unit = {}

override fun onFocusChanged(focused: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
if (isInTouchMode && focused) {
performClick()
clearFocus()
} else {
super.onFocusChanged(focused, direction, previouslyFocusedRect)
}
}

override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_DEL) onBackspace()
return super.onKeyDown(keyCode, event)
Expand Down

0 comments on commit ec06534

Please sign in to comment.