-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ContextualMenu] Made disabled buttons focusable #4074
[ContextualMenu] Made disabled buttons focusable #4074
Conversation
const items: IContextualMenuItem[] = [ | ||
{ | ||
name: 'TestText 1', | ||
key: 'TestKey1', | ||
isDisabled: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still validate isDisabled, it needs to be removed in 6.0 once it's deprecated.
…into magellan/focusableDisabledItems
@@ -531,6 +531,10 @@ export class ContextualMenu extends BaseComponent<IContextualMenuProps, IContext | |||
const defaultRole = canCheck ? 'menuitemcheckbox' : 'menuitem'; | |||
const itemHasSubmenu = hasSubmenu(item); | |||
|
|||
const buttonNativeProperties = getNativeProps(item, buttonProperties); | |||
// Do not add the deleted attribute to the button so that it is focusable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo. Not deleted but disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll fix that.
* master: (28 commits) Scrollable pane sort stickies (microsoft#4111) Allow ScrollablePane to accept native properties. (microsoft#4095) Sticky (microsoft#4091) Applying package updates. [ColorRectangle, Sticky] Fixed null root refs (microsoft#4099) DatePicker: order of callbacks for onSelectDate and onAfterMenuDismiss (microsoft#4092) Applying package updates. Alhenry fix split button props (microsoft#4090) Fixing ComboBox styling by reverting button classname move (microsoft#4088) Update CODEOWNERS Undoing terrible change. [DetailsList] Fixed focus test (microsoft#4087) Added icons package screener test (microsoft#4082) ContextualMenu: Fix ContextualMenuUtility imports (microsoft#4085) [ContextualMenu] Made disabled buttons focusable (microsoft#4074) Convert Check to mergeStyles (microsoft#3880) [DetailsList] Add public focusIndex function (microsoft#3852) ComboBox button should have data-is-focusable="false" (microsoft#4070) Applying package updates. Focus Zone: Allow Tab to Skip Selection (microsoft#4061) ...
* Made disabled buttons focusable * Change file * Fixed test logic * Added test failure * Added isDisabled tests * Fixed tslint in test * Updated DetailsList snapshot * Fix typo
Pull request checklist
$ npm run change
Description of changes
Removed the
disabled
attribute from ContextualMenu buttons.Focus areas to test
Ensured that disabled buttons do no execute when clicked or when spacebar/enter is pressed while the button is focused. The button is not focusable via mouse but is focusable via keyboard navigation.