Skip to content

disallowTypeAhead does not work with Autocomplete and GridListΒ #9120

@rilescode

Description

@rilescode

Provide a general summary of the issue here

I am using a GridList with AutoComplete, and want to disallow typeahead. Setting disallowTypeahead does not do this.

Update: I believe this is true for any GridList with GridListItems that set a textValue.

πŸ€” Expected Behavior?

Setting disallowTypeahead disables typeahead

😯 Current Behavior

setting disallowTypeahead on the GridList does not disable typeahead.

πŸ’ Possible Solution

In: `useAutocomplete::154` `shouldUseVirtualFocus` is getting set to false here because the GridList has a tab index of 0, which then means that `disallowTypeahead` is always set to false.
if (node.getAttribute('tabindex') != null) {
  setShouldUseVirtualFocus(false);
}

disallowTypeAhead is not correctly passed through in useGridList.

πŸ”¦ Context

No response

πŸ–₯️ Steps to Reproduce

https://codesandbox.io/p/sandbox/frosty-artem-9pmx3l?file=%2Fsrc%2FApp.js%3A125%2C8

Version

latest

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macos

🧒 Your Company/Team

No response

πŸ•· Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions