-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(core): add selectedOptionsOrder
in useSelect
#6071
Conversation
🦋 Changeset detectedLatest commit: 49c26e3 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
selectedOptionsOrder
in useSelect
selectedOptionsOrder
in useSelect
@@ -149,6 +149,20 @@ useSelect({ | |||
|
|||
> For more information, refer to the [`useMany` documentation →](/docs/data/hooks/use-many) | |||
|
|||
### selectedOptionsOrder |
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.
Documentation of other useSelect
hooks and extensions should also include this prop:
Hook | File |
---|---|
@refinedev/core#useSelect |
documentation/docs/data/hooks/use-select/index.md |
@refinedev/antd#useSelect |
documentation/docs/ui-integrations/ant-design/hooks/use-select/index.md |
@refinedev/antd#useRadioGroup |
documentation/docs/ui-integrations/ant-design/hooks/use-radio-group/index.md |
@refinedev/antd#useCheckboxGroup |
documentation/docs/ui-integrations/ant-design/hooks/use-checkbox-group/index.md |
@refinedev/mui#useAutocomplete |
documentation/docs/ui-integrations/material-ui/hooks/use-auto-complete/index.md |
Additionally, some of them might require small adjustments to make it work:
useRadioGroup
anduseCheckboxGroup
should pass the prop to theuseSelect
hook.useAutocomplete
is going to require an additional logic to make the prop work since it uses data directly rather thanoptions
fromuseSelect
.
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 have updated the related components & the docs. Let me know if I'm missing something.
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.
Hey @Dominic-Preap, thank you for the contribution! 🚀 There was a small issue in the test case, I pushed a fix for it! Other than that, I left a comment about the documentation and some adjustments that might be needed for the extensions of the useSelect
hook.
Let us know if you can work on these as well 🙏
Okay I'll update it tonight. |
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.
Thank you for the update @Dominic-Preap! I've sent a small update and added @refinedev/antd
and @refinedev/mui
to the changeset 🚀
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
Cannot sort
selectedOptions
at the top of list when useuseSelect
withdefaultValue
.What is the new behavior?
feat: add
selectedOptionsOrder
inuseSelect
Fixes #6061