Skip to content
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

Merged
merged 1 commit into from
Nov 11, 2016
Merged

Conversation

kara
Copy link
Contributor

@kara kara commented Nov 1, 2016

This PR adds support for disabling the select and its options. Needs to be rebased once #1657 and #1655 go in.

r: @jelbourn

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 1, 2016
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 6, 2016
… 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%);
Copy link
Member

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']) & {
Copy link
Member

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.

crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 9, 2016
… 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.
@kara
Copy link
Contributor Author

kara commented Nov 9, 2016

@jelbourn Comments addressed!

@jelbourn
Copy link
Member

LGTM

@kara kara added the action: merge The PR is ready for merge by the caretaker label Nov 10, 2016
</md-card>

<md-card>
<md-select placeholder="Drink" [(ngModel)]="currentDrink" [required]="isRequired" [disabled]="isDisabled"
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@jelbourn jelbourn merged commit d0f4c3e into angular:master Nov 11, 2016
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 19, 2016
… 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.
tinayuangao pushed a commit that referenced this pull request Nov 29, 2016
… 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.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants