Skip to content

[Select] - First options receives .Mui-focusVisible always #23747

@orest22

Description

@orest22
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

There is some issue with :focus-visible for Select. For the first time when there is no value selected .Mui-focusVisible class is getting applied to the first item in a list. This is not the case for the Menu component though. Also, this happens only in Chrome.

Expected Behavior 🤔

Same behaviour as the Menu component has.

Steps to Reproduce 🕹

Two components side by side:https://codesandbox.io/s/material-ui-issue-forked-udm04?file=/src/Demo.js

Steps:

Case 1:

  1. Open Select via mouse click
  2. The first item is highlighted with a red border meaning the focusVisible class was added

Case 2:

  1. Refresh a page
  2. Open Menu via mouse click everything works as expected

Context 🔦

Want have focus applied on Select only when it was focused with a keyboard. The options should also stay without focus if the keyboard wasn't used

Your Environment 🌎

Tech Version
Material-UI v5.0.0.alpha.17
React 17
Browser Chrome
TypeScript
etc.

Metadata

Metadata

Assignees

Labels

scope: selectChanges related to the select.type: bugIt doesn't behave as expected.
No fields configured for issues without a type.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions