fenix icon indicating copy to clipboard operation
fenix copied to clipboard

[Bug] [a11y] On Onboarding the focus jumps on the header of the screen instead of Theme card after a theme is selected

Open lobontiumira opened this issue 7 years ago • 13 comments

Prerequisites

Make sure to have a clean profile.

Steps to reproduce

  1. Enable Talkback.
  2. Open Firefox Preview and go to Theme card.
  3. Tap on Dark theme.
  4. Double tap on Dark theme to activate it.

Expected behavior

The theme is changed, and the focus remains on Theme card.

Actual behavior

The theme is changed, but the focus moves to the search bar. The same behavior is encountered if Automatic selected, or Light theme.

Device information

  • Android device: OnePlus 5T (Android 9)
  • Fenix version: 6/13

logcat.talkback.txt

talkbackthemes

┆Issue is synchronized with this Jira Task

lobontiumira avatar Jun 13 '19 12:06 lobontiumira

After doing some research on the issue, it seems that the focus change with the talkback activated is caused by the activity recreation after setting the new theme thru the function OnboardingThemePickerViewHolder.setNewTheme(mode: Int).

Inside the mentioned function is a call to AppCompatDelegate.setDefaultNightMode(mode) where its documentation states "If this method is called after any host components with attached AppCompatDelegates have been 'started', a uiMode configuration change will occur in each. This may result in those components being recreated, depending on their manifest configuration."

Additionally, the uiMode configuration change is not set inside the manifest.

I would like to have some technical input on how to address the situation because it is the expected behavior from the OS. There are some alternatives such as forcing the ´uiMode´ on the manifest but I believe it requires further discussion.

Technical Details

  • Device: Android Emulator
  • OS : Android 7.1.1 API 25
  • Talkback version: Android Accessibility Suite 7.3.0.239841594
  • Firefox Preview Version: 1.0.11926

nicolashleon avatar Jun 28 '19 23:06 nicolashleon

I think we could check if the theme chooser was focused and store that in a viewmodel or shared preferences here. If the chooser was focused, it should be refocused when the activity is created again.

NotWoods avatar Sep 30 '19 03:09 NotWoods

This issue is still reproducible on OnePlus 5T (Android 9) on the latest Nightly build 10/18 (#12910609).

lobontiumira avatar Oct 18 '19 11:10 lobontiumira

Looked a bit into this one, de-assigned myself for a few reasons:

  1. Seems like a majority of the android community highly opposes any accessibility auto-focus (maybe the accessibility users know that changes to the page move the focus on the top?)
  2. Even disregarding the first reason, at this moment, I can't find a way to programatically set the accessibility focus WITHOUT the actual talk-back voice (which makes it a bit weird for the user to hear again that the focus is set on the theme selector)
  3. Furthermore, since Talkback scans the screen and then traverses the children, it takes some time to set its focus on the first element. So setting the focus accessibility event will get overridden if we do it too early, and using delays could lead to inconsistent behaviour on different phones

There might be a way by changing the traversal order of this element to before the first focusable element in the activity, but again, the first 2 reasons still apply

BranescuMihai avatar Nov 01 '19 16:11 BranescuMihai

I was able to reproduce this issue, again, on 3.0.0-beta.3 build. After selecting a theme, the selection jumps on the header of the screen selecting the element that is displayed there. Reproduced with LG G7 Fit (Android 8.1).

lobontiumira avatar Dec 06 '19 08:12 lobontiumira

This is reproducible with Talkback disabled, when the dark theme is selected. Not reproducible when the theme is changed from automatic to light. Nightly build 01/04.

20200401_150644

sflorean avatar Apr 01 '20 12:04 sflorean

Hi, issue is still reproducible with Sony Xperia Z5 (Android 7) on Firefox Nightly 4/22. Note:

  • After activating/enabling dark theme the talk back starts from the private browsing button. The same outcome is present when selecting white theme.

Diana-Rus avatar Apr 22 '20 09:04 Diana-Rus

I was able to reproduce this issue on the latest Nightly build from 9/10 with HTC 10 (Android 8). The focus jumped on the three-dot menu after selecting the dark theme.

lobontiumira avatar Sep 10 '20 07:09 lobontiumira

Reproducible on beta 86.0.0-beta.5 with Talkback on, with Xiaomi Mi 8 Lite (Android 9).

lobontiumira avatar Feb 16 '21 07:02 lobontiumira

This issue reproduces on the Beta 90.0.0-beta.3 build with Talkback on, on OnePlus 5T (Android 10).

lobontiumira avatar Jun 15 '21 06:06 lobontiumira

I was able to reproduce this issue on the 11/2 Nightly build with Sony Xperia Z5 Premium (Android 7.1.1).

lobontiumira avatar Nov 02 '21 12:11 lobontiumira

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 01 '22 16:05 stale[bot]

This is no longer available since the "Choose your theme card" is the first displayed. Closing as worksforme.

sflorean avatar May 05 '22 11:05 sflorean