angular / components

Component infrastructure and Material Design components for Angular

Home Page:https://material.angular.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug(MatSelect): Mat-select click event is not happening with focus

Sathishhari196 opened this issue · comments

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

(focus)="matselectTemplateRef.open()
Along with it one more click event is used. we use both event for same mat-select and on focus if we call open() then only focus is triggered for both click and focus event.

https://stackblitz.com/edit/w6h39v-nzk8nh?file=src%2Fexample%2Fselect-multiple-example.html

Reproduction

StackBlitz link:
Steps to reproduce:

  1. Use click and focus event for same mat-select
    2.On focus call matselect open() method.

Expected Behavior

On click , click event to be triggered.

Actual Behavior

On click, focus is triggered if we use open method on focus for both click and focus

Environment

All environment

Why you are forcing the select dropdown to open upon focus? While visually it might look better, it kind of goes against how other dropdowns usually work. I would recommend not adding this behavior since it would be a bit jarring for screenreader users who are navigating a page and suddenly have an open select dropdown they did not decide to open yet. I think keeping the behavior to other select dropdowns is the best experience for users.

Closing since there hasn't been a response.