-
Notifications
You must be signed in to change notification settings - Fork 538
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
Selectpanel2: Remove SelectPanel.ActionList API #3764
Conversation
…/react into drafts-replace-heading-with-title
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
size-limit report 📦
|
{/* render default header as fallback */} | ||
{slots.header || <SelectPanel.Header />} | ||
{childrenInBody} | ||
<Box | ||
sx={{ |
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.
moved the styles from SelectPanel.ActionList here
This reverts commit 02901a8.
…simplify-actionlist
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.
Just left a question and the API change makes sense to me 👍🏻
@@ -55,13 +54,13 @@ const SelectPanel = props => { | |||
React.useEffect(() => setInternalOpen(props.open), [props.open]) | |||
|
|||
const onInternalClose = () => { | |||
if (props.open === 'undefined') setInternalOpen(false) | |||
if (props.open === undefined) setInternalOpen(false) |
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.
Oops I didn't catch that in the previous PR too 😬
listRole: 'listbox', | ||
selectionAttribute: 'aria-selected', |
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.
From what I understand, the role is always going to be listbox
and selectionAttribute be aria-selected
for SelectPanel. is that right?
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.
Yep, that is always true :)
Part 1: tiny API change
API before this PR:
Hard to guess that it's
SelectPanel.ActionList
butActionList.Item
,ActionList.LeadingVisual
inside it etc.We could recommend
SelectPanel.ActionList.Item
andSelectPanel.Item.LeadingVisual
SelectPanel.Item
andSelectPanel.LeadingVisual
...but, it feels even nicer if we don't need either. ActionList already supports a composition-friendly context for container components.
New API:
Part 2: it's free
real estateaccessibility attributesUtilising the
ActionListContainerContext
, we can set role for ActionList from the container (SelectPanel) and adapt item roles within ActionList