-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(select): support disabling #1667
Conversation
… from ControlValueAccessor Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (angular#1667). Fixes angular#1171.
|
||
// Gradient for showing the dashed line when the input is disabled. | ||
$md-underline-disabled-background-image: | ||
linear-gradient(to right, rgba(0, 0, 0, 0.26) 0%, rgba(0, 0, 0, 0.26) 33%, transparent 0%); |
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.
Add comment saying why you use a linear-gradient like this instead of a border?
@@ -11,12 +11,12 @@ | |||
color: md-color($foreground, hint-text); | |||
border-bottom: 1px solid md-color($foreground, divider); | |||
|
|||
md-select:focus & { | |||
md-select:focus:not([aria-disabled='true']) & { |
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.
Can we add a class for this instead? Using the aria-disabled
makes the selectors somewhat noisy.
… from ControlValueAccessor Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (angular#1667). Fixes angular#1171.
@jelbourn Comments addressed! |
LGTM |
</md-card> | ||
|
||
<md-card> | ||
<md-select placeholder="Drink" [(ngModel)]="currentDrink" [required]="isRequired" [disabled]="isDisabled" |
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.
currentDrink
needs to be defined in the class.
(failing google presubmit)
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.
Fixed
1ae0a35
to
4fa4aa6
Compare
… from ControlValueAccessor Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (angular#1667). Fixes angular#1171.
… from ControlValueAccessor (#1750) Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (#1667). Fixes #1171.
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. |
This PR adds support for disabling the select and its options. Needs to be rebased once #1657 and #1655 go in.
r: @jelbourn