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

[docs][material-ui][Autocomplete] Hint demo is broken #42882

Closed
stealthco-tony opened this issue Jul 7, 2024 · 2 comments · Fixed by #42990
Closed

[docs][material-ui][Autocomplete] Hint demo is broken #42882

stealthco-tony opened this issue Jul 7, 2024 · 2 comments · Fixed by #42990
Assignees
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: material-ui Specific to @mui/material regression A bug, but worse

Comments

@stealthco-tony
Copy link

stealthco-tony commented Jul 7, 2024

Related page

https://mui.com/material-ui/react-autocomplete/

Kind of issue

Broken demo

Issue description

I think this content is broken/outdated. Please review and update.

  • the "matchingOption" variable is constantly empty
  • the dropdown does not show the selected option after clicking on it
  • clicking "ENTER" on the keyboard over a selected option does not select it
  • There is no default value for the value prop in the Autocomplete component

Additional features to add:

  1. Show the difference of a displayedValue vs storedValue (like in a <select> element)
  2. Show how this would work with an inboundValue (URL querystring param). So imagine the page was loaded with a URL parameter specifying which option should be shown by default. Right now with your code, it will hide ALL the other options and not allow deleting/removing.

Context

Here is what I need my Autocomplete to do:

  1. Store the component as a separate file.
  2. Accept inbound parameters: data (the array of options), defaultValue (the default option to show onload, may be null), onChangeFunc, a function from a parent component to call onChange
  3. Set the selectedValue to the inbound displayed/stored value (defaultValue and its associated label from the data array) if exists
  4. Create the autocomplete as per the "Hint" demo
  5. Allow for typing and filtering the displayed list. If the user selects a new option, pass the value (not inputValue) to the onChangeFunc
  6. If the user starts to delete characters (even after starting with a default Value/inputValue), show all the others in the data array.

Thank you!

Search keywords: autocomplete

@stealthco-tony stealthco-tony added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Jul 7, 2024
@zannager zannager added the component: autocomplete This is the name of the generic UI component, not the React module! label Jul 8, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title Autocomplete with Hint is Broken [material-ui][Autocomplete] Hint demo is broken Jul 21, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Autocomplete] Hint demo is broken [docs][material-ui][Autocomplete] Hint demo is broken Jul 21, 2024
@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work docs Improvements or additions to the documentation package: material-ui Specific to @mui/material regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Jul 21, 2024
@ZeeshanTamboli
Copy link
Member

It's a regression since the demo creation in #37496. @sai6855 Can you take a look? PR: #42990

@ZeeshanTamboli
Copy link
Member

We have fixed the demo in #42990. For the additional features you mentioned, you need to customize your custom Autocomplete component. We can't support all such things in our Autocomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: material-ui Specific to @mui/material regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants