question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Autocomplete] Keyboard arrow key option selection broken with custom PopperComponent and renderInput

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Click on autocomplete component.
  2. Focus should now be on the input field.
  3. Press arrow key down until highlighting the last option at bottom of the list.
  4. Press arrow key down once more.
  5. Top options are not visible and are hidden behind the input field.

Current behavior 😯

When having an autocomplete with a custom renderInput andPopperComponent as highlighted in autocomplete docs, keyboard navigation is not working as expected. When the option selection wraps from the last to the first element using arrow keys, the option is hidden under the input field.

Expected behavior 🤔

When the first option is selected after being navigated via the keyboard from the last option, the options list should look like the state when first rendered/opened. (option should be visible)

Context 🔦

I am trying to tackle a few usability tickets and was able to track the source of this bug to MUI. Since our implementation is mutated from the autocomplete examples provided I am assuming this is an undesired/uncaught bug, since it impacts usability and user experience.

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.

- Tested on Google Chrome, on OSX with most recent updates for both.

  Output from `npx @mui/envinfo` goes here.

- Tested / recreated on sandbox linked above, don't know how to run npx commands on there 🤷 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sai6855commented, Nov 16, 2022

sure, i don’t mind

0reactions
michaldudakcommented, Nov 16, 2022

@RyanBarclay sure, I don’t mind. Alternatively you could send a PR to @sai6855’s branch or contribute directly to his PR (after you get permissions).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to fix popper placement in autocomplete
Yes, placement appears to be broken when used in Autocomplete's Popper (material-ui v. 4.11.4). A hack that worked for me is as follows:...
Read more >
Customize MUI Autocomplete with getOptionLabel ...
Learn how to use getOptionLabel, renderInput, and renderOption in Material-UI's Autocomplete. We'll also custom style the component and ...
Read more >
Autocomplete API - Material UI - MUI
Name Type Default options * array renderInput * func autoComplete bool false
Read more >
jquery-ui autocomplete
I'm trying to create a form that has an autocomplete dropdown in phonegap. ... cannot scroll through and select the options with the...
Read more >
Customizing the Material-UI Autocomplete Component
The Autocomplete component may have the most customization options of any MUI component I've seen. Unfortunately, I found that custom ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found