fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

ChoiceGroup: focus is wrong when using ChoiceGroup inside of Panel

Open SumiranAgg opened this issue 8 years ago • 8 comments

Bug Report

OS: Windows 10 RS3 OS version: build 16299.371 Browser: Microsoft edge browser Edge version: Microsoft Edge 41.16299.371.0 Firefox version: 59.0.2 (32-bit) Version:20180413T115929

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? (Yes, No) No

Requested priority: (Blocking, High, Normal, Low) Normal

Products/sites affected: (if applicable) VSTS

Describe the issue: Panel focus order is improper when choice group is rendered within the Panel.

Actual behavior: Suppose you have choice group with options "a" and "b" in the panel.

The focus first goes to cross button of the panel, then the choice group option "a", then tabbing will make you focus the page title/window etc.

If you select option "b" my moving key down, then the focus will remain inside the Panel which is the expected behavior. But by default, as "a" is selected, the focus goes out of the Panel

Expected behavior: Focus order should remain inside the panel only

If applicable, please provide a codepen repro:

SumiranAgg avatar Jun 11 '18 06:06 SumiranAgg

Aware that this is duplicate for https://github.com/OfficeDev/office-ui-fabric-react/issues/4191. Was closed without resolution hence re-opening. PLEASE DO NOT CLOSE AS DUP.

SumiranAgg avatar Jun 11 '18 06:06 SumiranAgg

#4938 possibly related. I will take a look at soon.

JasonGore avatar Jun 14 '18 17:06 JasonGore

@JasonGore - this PR by @bworline fixed something very similar: https://github.com/OfficeDev/office-ui-fabric-react/pull/4898 . Could you please check if this is already fixed?

aditima avatar Jun 14 '18 20:06 aditima

This still appears to be an issue. It also affects not just the first ChoiceGroup item, but every ChoiceGroup item excluding the last. Here is a CodePen with repro. Even with an input as the first element of Panel, the first option in ChoiceGroup exits the Panel when tabbed from. As a result, I suspect this is an issue with ChoiceGroup and not Panel.

JasonGore avatar Aug 07 '18 18:08 JasonGore

This is only occurs when ChoiceGroup is the last element within Panel. If there are any other elements after ChoiceGroup, tabbing out of ChoiceGroup selects the the next element.

Further analysis shows that FocusTrapZone is not detecting ChoiceGroup as a whole as the last tabbable child, only the last ChoiceGroupOption. As a result, FocusTrapZone does not trap tabs from any other ChoiceGroupOption, which ends up highlighting the next element outside of FocusTrapZone.

JasonGore avatar Aug 07 '18 19:08 JasonGore

This issue will again occur with the merge of #8053. This issue will remain closed but is covered by #8055.

JasonGore avatar Feb 21 '19 01:02 JasonGore

:tada:This issue was addressed in #8216, which has now been successfully released as @uifabric/[email protected].:tada:

Handy links:

msft-github-bot avatar Mar 12 '19 12:03 msft-github-bot

:tada:This issue was addressed in #8216, which has now been successfully released as [email protected].:tada:

Handy links:

msft-github-bot avatar Mar 12 '19 12:03 msft-github-bot