Skip to content

Autocomplete dumps focus to body when selecting via mouse #4645

@iblocks-Xander

Description

@iblocks-Xander

Bug, feature request, or proposal:

When selecting an option using the keyboard, the host input does not blur on selection. However, when selecting an option using the mouse, the host input blurs.

What is the expected behavior?

As the MdSelect does not blur on clicking an option or selecting via the keyboard, I think that clicking should probably not blur the input. Or at least, the option for specifying the behavior should be present.

What is the current behavior?

The input blurs on click but not on keyboard selection.

What are the steps to reproduce?

The example plunks for the MdAutoComplete and the MdSelect show their corresponding behaviour.
https://plnkr.co/edit/ASQ9jmd8h5Y13kyD2wRI

What is the use-case or motivation for changing an existing behavior?

Bringing MdSelect and MdAutocomplete behavior into alignment

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 4.x, Material Beta 3.

Is there anything else we should know?

I'm not sure if this helps, but I can see a preventDefault in the keyboard event handling in MdAutoComplete here: https://github.com/angular/material2/blob/master/src/lib/autocomplete/autocomplete-trigger.ts#L236

This could be why the keyboard is not blurring the input?

Metadata

Metadata

Assignees

Labels

AccessibilityThis issue is related to accessibility (a11y)P2The issue is important to a large percentage of users, with a workaround

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions