-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat(multi-select, simple-select): add listActionButton & onListAction #7044
base: master
Are you sure you want to change the base?
Conversation
a5b2fd4
to
a1de7e7
Compare
@@ -284,6 +284,65 @@ export const MultiSelectMultiColumnsComponent = ( | |||
); | |||
}; | |||
|
|||
export const MultiSelectWithActionButtonComponent = () => { |
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.
suggestion (non-blocking): might be worth just using the list action button to add the new options so it's a bit simpler, opening a dialog seems a bit left field to me
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.
Leave this for now until we've had confirmation about how it should behave when the button is clicked
@@ -365,6 +424,29 @@ export const MultiSelectCustomColorComponent = ( | |||
); | |||
}; | |||
|
|||
export const MultiSelectListActionEventComponent = ( | |||
props: Partial<MultiSelectProps> |
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.
suggestion (non-blocking): you could make onListAction
Required
here so it's flagged if someone ever uses it and doesn't pass the callback etc
@@ -529,6 +547,11 @@ export const MultiSelect = React.forwardRef<HTMLInputElement, MultiSelectProps>( | |||
isMouseDownReported.current = true; | |||
} | |||
|
|||
function handleOnListAction() { | |||
setOpenState(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.
Question: as the list closes when the button is clicked, will this really work for lazy loading?
@harpalsingh fyi
fix #6752
Proposed behaviour
Adds the
listActionButton
prop andonListAction
callback to theMultiSelect
andSimpleSelect
components.Current behaviour
Currently, only
FilterableSelect
has thelistActionButton
prop andonListAction
callback.Checklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions