-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[OptionList] consolidate se23 styles and logic #10177
Conversation
); | ||
|
||
const checkBoxRole = role === 'option' ? 'presentation' : undefined; |
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.
According to the MDN the presentation
role is ignored on all focusable elements (including inputs), so this would just default back to the implicit 'checkbox' role in the browser.
After a cursory screen reader test, I also couldn't find any behavioural differences from this change.
onChange={handleClick} | ||
/> | ||
) : ( | ||
<Checkbox |
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.
Since we're no longer using the custom checkbox (or exporting it from root), its also deleted in this PR.
@@ -28,8 +26,6 @@ export interface OptionListProps { | |||
options?: OptionDescriptor[]; | |||
/** Defines a specific role attribute for the list itself */ | |||
role?: 'listbox' | 'combobox' | string; | |||
/** Defines a specific role attribute for each option in the list */ | |||
optionRole?: string; |
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.
I think removing the prop given the reasons outlined in the PR description is the right thing to do, however I'll defer to the team here as to whether or not we want to deprecate
first.
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.
I think your grokt search makes this pretty safe to remove, @kyledurand is there a list or somewhere where we are tracking the changed props for v12?
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.
Given the context you provided, if the optionRole
prop was only used in Option
and with the custom checkbox component that was rendered without the beta flag, I think it makes sense to remove it with the v12 release 👍
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.
@gwyneplaine "Component changes" tasklist in this issue can be updated to included optionRole
prop removal
4507a3a
to
876aa12
Compare
I'm incredibly stumped as to why this UI test changed. Can't find a specific change in the PR that would lead to the change. |
I wonder if this is coming from the fact that the |
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.
Nice 🙌 🌟
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.
Nice clean up!! I think the UI baseline is good to approve it might just be a dom change but visually it looks the same to me! idk if that answer warrants a bagel or not 🥯😅
@@ -28,8 +26,6 @@ export interface OptionListProps { | |||
options?: OptionDescriptor[]; | |||
/** Defines a specific role attribute for the list itself */ | |||
role?: 'listbox' | 'combobox' | string; | |||
/** Defines a specific role attribute for each option in the list */ | |||
optionRole?: string; |
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.
I think your grokt search makes this pretty safe to remove, @kyledurand is there a list or somewhere where we are tracking the changed props for v12?
@@ -76,4 +76,3 @@ Controls in simple option lists are [buttons](https://polaris.shopify.com/compon | |||
If you customize the option list, you can provide ARIA roles that fit the context. These roles must be valid according to the [W3C ARIA specification](https://www.w3.org/TR/wai-aria-1.1/) to be conveyed correctly to screen reader users. | |||
|
|||
- The `role` prop adds an ARIA role to the option list wrapper | |||
- The `optionRole` prop adds an ARIA role to the option list items |
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.
@yurm04 would this conflict at all with your polaris.shopify.com changes?
### WHY are these changes introduced? Resolves #10035. Updates existing `tall-chickens-repeat` changeset with all the component consolidation work (included any in progress/ready for review/up next/backlog PRs as well). Adds changesets for [OptionList](#10177) `optionRole` and [Page](#10187) `divider` prop removal.
* next: (87 commits) [ButtonGroup] Removed `segmented` boolean prop and replaced with `variant` (#9997) [LegacyTabs] Consolidate se23 styles and logic (#10231) [v12] Update changesets (#10232) [LegacyFilters] Consolidate se23 styles and logic (#10217) [Banner] Change status prop to tone (#10206) Replace icon highlight color in box stories (#10226) [TopBar] Consolidate se23 styles and logic (#10221) [Filters] consolidate se23 logic and styles (#10178) [Icon] Update props (#10220) [ButtonGroup] Update variant plain prop name (#10222) [Button] Remove connectedDisclosure (#10182) [LegacyCard] Consolidate se23 styles and logic (#10207) [Navigation] Consolidate se23 logic and styles (#10213) [Frame][ContextualSaveBar] Consolidate se23 styles and logic (#10196) [OptionList] consolidate se23 styles and logic (#10177) [Page] Consolidate se23 styles and logic (#10187) [DataTable] Consolidate conditional logic (#10169) [Thumbnail] Consolidate conditional logic (#10171) [ResourceItem] Consolidate conditional logic (#10172) [FullscreenBar] Consolidate conditional logic (#10173) ...
* next: (87 commits) [ButtonGroup] Removed `segmented` boolean prop and replaced with `variant` (#9997) [LegacyTabs] Consolidate se23 styles and logic (#10231) [v12] Update changesets (#10232) [LegacyFilters] Consolidate se23 styles and logic (#10217) [Banner] Change status prop to tone (#10206) Replace icon highlight color in box stories (#10226) [TopBar] Consolidate se23 styles and logic (#10221) [Filters] consolidate se23 logic and styles (#10178) [Icon] Update props (#10220) [ButtonGroup] Update variant plain prop name (#10222) [Button] Remove connectedDisclosure (#10182) [LegacyCard] Consolidate se23 styles and logic (#10207) [Navigation] Consolidate se23 logic and styles (#10213) [Frame][ContextualSaveBar] Consolidate se23 styles and logic (#10196) [OptionList] consolidate se23 styles and logic (#10177) [Page] Consolidate se23 styles and logic (#10187) [DataTable] Consolidate conditional logic (#10169) [Thumbnail] Consolidate conditional logic (#10171) [ResourceItem] Consolidate conditional logic (#10172) [FullscreenBar] Consolidate conditional logic (#10173) ...
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes #9953 Fixes #10197 ### WHAT is this pull request doing? - `OptionList` consolidate se23 logic - `OptionList` consolidate se23 styles - Remove custom `Checkbox` component in favour of the standard Polaris Checkbox - Removes the `optionRole` prop from the `OptionList` component. This is presently being used to toggle the `presentation` role on the custom checkbox input. This PR removes this prop for a few reasons: - Its no longer used, since the custom Checkbox has been deleted. - The functionality it was providing (toggling presentation role) doesn't seem to be [supported by browsers](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role). The browser ignores the `presentation` role on all focusable elements (including inputs). See excerpt from MDN below - A cursory [Grokt](https://grokt.shopify.io/results?q=optionRole) search, rules out internal usage of this prop ![Screenshot 2023-08-23 at 10 16 07 am](https://github.com/Shopify/polaris/assets/12119389/fbf6718b-ad35-46ee-ad00-6c79840ff02b) ### How to 🎩 - Storybook - Prod storybook ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
### WHY are these changes introduced? Resolves #10035. Updates existing `tall-chickens-repeat` changeset with all the component consolidation work (included any in progress/ready for review/up next/backlog PRs as well). Adds changesets for [OptionList](#10177) `optionRole` and [Page](#10187) `divider` prop removal.
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes Shopify#9953 Fixes Shopify#10197 ### WHAT is this pull request doing? - `OptionList` consolidate se23 logic - `OptionList` consolidate se23 styles - Remove custom `Checkbox` component in favour of the standard Polaris Checkbox - Removes the `optionRole` prop from the `OptionList` component. This is presently being used to toggle the `presentation` role on the custom checkbox input. This PR removes this prop for a few reasons: - Its no longer used, since the custom Checkbox has been deleted. - The functionality it was providing (toggling presentation role) doesn't seem to be [supported by browsers](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role). The browser ignores the `presentation` role on all focusable elements (including inputs). See excerpt from MDN below - A cursory [Grokt](https://grokt.shopify.io/results?q=optionRole) search, rules out internal usage of this prop ![Screenshot 2023-08-23 at 10 16 07 am](https://github.com/Shopify/polaris/assets/12119389/fbf6718b-ad35-46ee-ad00-6c79840ff02b) ### How to 🎩 - Storybook - Prod storybook ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
WHY are these changes introduced?
Fixes #9953
Fixes #10197
WHAT is this pull request doing?
OptionList
consolidate se23 logicOptionList
consolidate se23 stylesCheckbox
component in favour of the standard Polaris CheckboxoptionRole
prop from theOptionList
component. This is presently being used to toggle thepresentation
role on the custom checkbox input. This PR removes this prop for a few reasons:presentation
role on all focusable elements (including inputs). See excerpt from MDN belowHow to 🎩
🎩 checklist
README.md
with documentation changes