-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Move SelectUnstyled docs to the Base space #31816
Conversation
@michaldudak You might have to do the same with https://github.com/mui/material-ui/pull/31417/files#diff-0f62cd80e39c6c4c31bfbd4d836a0e888559f35b05d9d1d833db0e815d94d6f3 so that the |
2 points for discussion:
"The SelectUnstyled component" should be just "Select unstyled" |
Co-authored-by: Sam Sycamore <[email protected]> Co-authored-by: Siriwat K <[email protected]>
@siriwatknp It doesn't feel right. The "Basic usage", "Controlled select", etc. are about the unstyled component, so to me, it makes sense to have them nested.
All right, no problem. |
bc4a3a9
to
926efaf
Compare
Co-authored-by: Sam Sycamore <[email protected]>
The `SelectUnstyled` component accepts generic props. | ||
Due to TypeScript limitations, this may cause unexpected behavior when wrapping the component in `forwardRef` (or other higher-order components). | ||
In such cases, the generic argument will be defaulted to `unknown` and type suggestions will be incomplete. | ||
To avoid this, you can manually cast the resulting component to the correct type, as shown in the demo above. |
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.
How about we show a short code snippet of this instead of asking developers to open the previous demo?
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.
Good call!
|
||
{{"demo": "UnstyledSelectMultiple.js", "defaultCodeOpen": false}} | ||
|
||
## The useSelect hook |
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.
## The useSelect hook | |
## The `useSelect` hook |
?
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 we want to avoid back ticks in headers. At least, I think that's the way it already is elsewhere in the docs. But maybe we don't have a consistent pattern established.
Co-authored-by: Marija Najdova <[email protected]>
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.
Two last comments from my side, the rest looks good
|
||
# Select | ||
|
||
<p class="description">The SelectUnstyled and MultiSelectUnstyled components let you create menus of options for users to choose from.</p> |
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.
<p class="description">The SelectUnstyled and MultiSelectUnstyled components let you create menus of options for users to choose from.</p> | |
<p class="description">The select components allow developers to create menus of options for users to choose from.</p> |
We are already mentioning below the name of the components, so it's redundant. Also, to keep consistent with other docs pages, I have rephrased a bit.
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 #31850 (comment), "allow" is not the best word to use here. How about "The select components let you create..."
Also, I'm not sure about the word "menus" here. I understand it may be used in a broader sense than "a menu component", but I'm afraid it could confuse developers and make them wonder which component should be used to actually implement a menu control.
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.
Ok, then we need to revisit all unstyled docs in the end and update this, some may have been merged already if I am not mistaken.
For the menus, I had the same thought, I was thinking list of options may be better. Similar terminology is used in wai aria too - https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/listbox-collapsible.html (fi this is the equivalent)
Co-authored-by: Sam Sycamore <[email protected]> Co-authored-by: Marija Najdova <[email protected]>
Moved the SelectUnstyled, MultiSelectUnstyled, OptionUnstyled, and OptionGroupUnstyled docs to the Base space.
Preview - https://deploy-preview-31816--material-ui.netlify.app/base/react-select/