mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.91k stars 32.27k forks source link

[Autocomplete] Still show results after selected #25289

Closed Lagicrus closed 3 years ago

Lagicrus commented 3 years ago

When you select a option from the drop down list with the Autocomplete module, and then click back into the box. It will "stop filtering" to your "search" and instead show all results e.g. If I typed "Bob", whilst I was typing it would only list say "Bob, Bobby, Bobbington" and so on. But if I chose "Bob" and then clicked back into the box, I would see the original list so "Ape, Bob, Cat" and so on.

I was wondering if this was intended behaviour and if there was a way to deactivate it?

Current Behavior 😯

After confirming a search result, the filter doesn't seem to work after

Expected Behavior 🤔

With a toggle, the results should still be filtered to what the user chose

Context 🔦

Improve the experience of searching as it can be very confusing if you click into a search box and you see results that have nothing to do with what you searched.

Your Environment 🌎

`npx @material-ui/envinfo` System: OS: Linux 4.19 Ubuntu 20.04.2 LTS (Focal Fossa) Binaries: Node: 10.19.0 - /usr/bin/node Yarn: 1.22.5 - /usr/bin/yarn npm: 7.5.4 - /mnt/e/OneDrive/GitHub/talespire/site/node_modules/.bin/npm Browsers: Chrome: Not Found Firefox: Not Found npmPackages: @material-ui/core: ^4.11.3 => 4.11.3 @material-ui/icons: ^4.11.2 => 4.11.2 @material-ui/lab: ^4.0.0-alpha.57 => 4.0.0-alpha.57 @material-ui/styles: 4.11.3 @material-ui/system: 4.11.3 @material-ui/types: 5.1.0 @material-ui/utils: 4.11.2 @types/react: 17.0.2 react: ^16.14.0 => 16.14.0 react-dom: ^16.14.0 => 16.14.0 typescript: 4.1.5 => 4.1.5
oliviertassinari commented 3 years ago

I was wondering if this was intended behaviour

Yes, this is by design.

and if there was a way to deactivate it?

Yes, provide your own filterOptions method.

Lagicrus commented 3 years ago

I was wondering if this was intended behaviour

Yes, this is by design.

and if there was a way to deactivate it?

Yes, provide your own filterOptions method.

Thanks for getting back to me and pointing me in the right direction :)