-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(select): don't blur label when trigger is blurred while the panel is opened #11537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -299,7 +299,10 @@ export class MatSelect extends _MatSelectMixinBase implements AfterContentInit, | |||
private _disableOptionCentering: boolean = false; | |||
|
|||
/** Whether the select is focused. */ | |||
focused: boolean = false; | |||
get focused(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A setter needs to be defined here as well.
With this change, the API is changed as focused
becomes readonly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn’t add a setter, because the MatFormFieldControl interface calls for the property to be readonly. That being said, it doesn’t look like TS actually enforces it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm okay, Lets add the setter as deprecated and then we can move it to readonly later
… is opened Considers a select as focused as long as a its panel is open, even if the trigger loses focus. This avoids cases where the label can be seen blinking in the background when an option is toggled in multi-select mode.
6cf8081
to
742fb85
Compare
Setter has been added. |
@crisbeto looks like there are some CI issues |
Seems like a flake. I’ve restarted it. |
… is opened (#11537) Considers a select as focused as long as a its panel is open, even if the trigger loses focus. This avoids cases where the label can be seen blinking in the background when an option is toggled in multi-select mode.
… is opened (#11537) Considers a select as focused as long as a its panel is open, even if the trigger loses focus. This avoids cases where the label can be seen blinking in the background when an option is toggled in multi-select mode.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Considers a select as focused as long as its panel is open, even if the trigger loses focus. This avoids cases where the label can be seen blinking in the background when an option is toggled in multi-select mode.
For reference:
