[a11y] Homescreen button remains focused when opening home screen despite it being disabled
Originally filed as https://github.com/mozilla-mobile-skunkworks/firefox-connect/issues/427
Steps to reproduce
- Enable VoiceView
- Go to a web site
- Click home screen button
Expected behavior
Home screen appears and home screen or overlay (to dismiss) are focused
Actual behavior
Home screen appears but the home screen button, which is now disabled, is focused. Linear navigation no longer works until a new view is focused with spatial navigation
Device information
- Echo Show device: any gen
- Firefox version: v1.1+
@eeejay Android discourages you from manually refocusing elements for a11y purposes but focusing the now disabled home button, which also breaks spatial navigation, seems broken. Do you know what the desired behavior should be here? I attached an annotated screenshot for reference:

Eitan mentioned that the homescreen is conceptually a dialog. On Android, focus typically moves to the first item in the dialog so that would be the appropriate behavior here too.
Retest after #117
I'm struggling to get this to work. In BF, I tried:
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
...
overlay.onGlobalLayoutOnce {
overlay.homeTiles.findViewHolderForLayoutPosition(0).itemView.requestFocus()
}
In various combinations of requesting focus on the RecyclerView or its children and nothing seems to happen.
I also tried:
launch(UI) {
delay(3000)
overlay.homeTiles.findViewHolderForLayoutPosition(1).itemView.requestFocus()
}
But this also doesn't seem to work.
I was unable to fix this in #162.