Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(select): md-select-header closes on mouse click when not using multiple #11970

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

Splaktar
Copy link
Contributor

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

  • select with md-select-header closes on mouse click of the header's input when not using multiple

Issue Number:
Fixes #11969

What is the new behavior?

  • if the click event came from within a md-select-header, stopImmediatePropagation()
    to keep the menu from closing
  • fix demo's input being too short to display label when 'Kale' is selected
  • rename some events and add types
  • update select header input's placeholder and add an aria-label

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

…ltiple

- if the click event came from within a `md-select-header`, `stopImmediatePropagation()`
  to keep the menu from closing
- fix demo's input being too short to display label when 'Kale' is selected
- rename some events and add types
- update select header input's placeholder and add an aria-label

Fixes #11969
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Jul 21, 2020
@Splaktar Splaktar self-assigned this Jul 21, 2020
@Splaktar Splaktar added P1: urgent Urgent issues that should be addressed in the next minor or patch release. severity: regression This issue is related to a regression labels Jul 21, 2020
@Splaktar Splaktar added this to the 1.2.0 milestone Jul 21, 2020
@Splaktar Splaktar requested a review from wagnermaciel July 21, 2020 19:52
@Splaktar Splaktar added pr: merge ready This PR is ready for a caretaker to review type: bug labels Jul 21, 2020
Copy link
Contributor

@wagnermaciel wagnermaciel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Splaktar Splaktar merged commit f2fca2e into master Jul 22, 2020
@Splaktar Splaktar deleted the select-header-close-on-click branch July 22, 2020 16:43
@Splaktar Splaktar restored the select-header-close-on-click branch July 22, 2020 19:52
@Splaktar Splaktar deleted the select-header-close-on-click branch July 22, 2020 22:34
@Splaktar
Copy link
Contributor Author

This has been cherry picked into the 1.1.x branch as well.

if (!option || !optionCtrl) {
// Avoid closing the menu when the select header's input is clicked
if (mouseEvent.target && mouseEvent.target.parentNode &&
mouseEvent.target.parentNode.tagName === 'MD-SELECT-HEADER') {
Copy link

@corvinb corvinb Oct 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input's are usually inside md-input-container's and this check would return false in this case. :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corvinb can you please open a new issue with a reproduction?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review severity: regression This issue is related to a regression type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

select(header): closes when filter input is focused
4 participants