Restore MarkdownEditText.focusSearch override (#4908)

This commit is contained in:
Jorge Martin Espinosa 2025-06-20 17:24:17 +02:00 committed by GitHub
parent 3ec965f23f
commit 4eb4692531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@
package io.element.android.libraries.textcomposer.components.markdown
import android.content.Context
import android.view.View
import androidx.appcompat.widget.AppCompatEditText
internal class MarkdownEditText(
@ -36,4 +37,10 @@ internal class MarkdownEditText(
onSelectionChangeListener?.invoke(selStart, selEnd)
}
}
// When using the EditText within a Compose layout, we need to override focusSearch to prevent the default behavior
// Otherwise it can try searching for focusable nodes in the Compose hierarchy while they're being laid out, which will crash
override fun focusSearch(direction: Int): View? {
return null
}
}