Skip to content

[SelectField] Focus reset after using keyboard to make selection #6080

@gji

Description

@gji

Problem description

Using the keyboard to choose a select field input causes the page focus to be reset to body. #5921 has

dropNode.focus();
dropArrow.setKeyboardFocus(true);

, but something is calling blur directly afterwards. Wrapping the code that grabs focus in a setTimeout makes it work, but is a pretty rough workaround.

Link to minimally-working code that reproduces the issue

Happens on http://www.material-ui.com/#/components/select-field
Tab over to the first select field, then [enter] [down] [enter]. Focus (verified with document.activeElement) is now on the body tag.

Tried making something on webpackbin, but tabbing doesn't work at all.

Versions

I've verified that the behavior is the same for me on:

  • Material-UI: 0.16.7
  • React: 15.4.2
  • Browser: Chrome 55, Firefox 47 on Linux Mint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: selectChanges related to the select.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions