Skip to content
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

[Autocomplete] Add hint demos to Material UI and Joy UI docs #37496

Merged
merged 4 commits into from
Jun 16, 2023

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Jun 4, 2023

Related to #22648

material ui preview: https://deploy-preview-37496--material-ui.netlify.app/material-ui/react-autocomplete#hint

joy ui preview: https://deploy-preview-37496--material-ui.netlify.app/joy-ui/react-autocomplete#hint

( Not Really sure where to place demos, so I've placed at last)

screen-recording-2023-06-03-at-102242-pm_gmdqqR8O.mov

@sai6855 sai6855 added docs Improvements or additions to the documentation package: material-ui Specific to @mui/material component: autocomplete This is the name of the generic UI component, not the React module! labels Jun 4, 2023
@mui-bot
Copy link

mui-bot commented Jun 4, 2023

@sai6855
Copy link
Contributor Author

sai6855 commented Jun 5, 2023

@siriwatknp Tried to add same demo to joy Autocomplete but somehow i couldn't able to get it working. Here is the sandbox if you want to try it out.

https://codesandbox.io/s/smoosh-snowflake-w9xn7e?file=/demo.js

@siriwatknp
Copy link
Member

@siriwatknp Tried to add same demo to joy Autocomplete but somehow i couldn't able to get it working. Here is the sandbox if you want to try it out.

https://codesandbox.io/s/smoosh-snowflake-w9xn7e?file=/demo.js

For Joy UI, you have to create a custom wrapper component and replace the default one. Here https://codesandbox.io/s/cool-shannon-5lzl7m?file=/demo.js

@sai6855
Copy link
Contributor Author

sai6855 commented Jun 7, 2023

@siriwatknp added demo for joy UI

@@ -195,6 +195,12 @@ The `size` can also be controlled at the `FormControl`.

{{"demo": "SizeWithLabel.js"}}

## Hint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make this an h3 so it sits under the "Customization" h2 and doesn't break the header flow:

Suggested change
## Hint
### Hint

@@ -195,6 +195,12 @@ The `size` can also be controlled at the `FormControl`.

{{"demo": "SizeWithLabel.js"}}

## Hint

Following demo shows how to add hinting feature to Autocomplete using `filterOptions` prop.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Following demo shows how to add hinting feature to Autocomplete using `filterOptions` prop.
The following demo shows how to add a hint feature to the Autocomplete using the `filterOptions` prop:

@@ -106,6 +106,12 @@ You could also display a dialog when the user wants to add a new value.

{{"demo": "FreeSoloCreateOptionDialog.js"}}

## Hint

Following demo shows how to add hinting feature to Autocomplete using `renderInput` and `filterOptions` prop.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Following demo shows how to add hinting feature to Autocomplete using `renderInput` and `filterOptions` prop.
The following demo shows how to a add hint feature to the Autocomplete using the `renderInput` and `filterOptions` props:

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩 This is awesome @sai6855, thanks for working on this. A very good example for using the slots prop.

I have updated the hint text to look good in dark mode and apply Sam's suggestion. Ready to go!

Signed-off-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
@samuelsycamore samuelsycamore changed the title [Autocomplete] Add hint demo [Autocomplete] Add hint demos to Material UI and Joy UI docs Jun 16, 2023
@samuelsycamore samuelsycamore added the package: joy-ui Specific to @mui/joy label Jun 16, 2023
@samuelsycamore samuelsycamore merged commit 911247c into mui:master Jun 16, 2023
19 checks passed
@sai6855 sai6855 deleted the autocomplete-hint branch June 17, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants