Skip to content

docs(input): add example of a clearable input #3730

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

Merged
merged 2 commits into from
Jul 5, 2017

Conversation

mmalerba
Copy link
Contributor

fixes #3725

@mmalerba mmalerba requested a review from jelbourn March 22, 2017 23:32
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 22, 2017
@jelbourn
Copy link
Member

I'm hesitant to change the examples here until we have them building.

@jelbourn
Copy link
Member

jelbourn commented May 1, 2017

@mmalerba can you rebase?

@mmalerba
Copy link
Contributor Author

mmalerba commented May 2, 2017

done

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, just one a11y fix needed

@@ -0,0 +1,4 @@
<md-input-container class="example-input-container">
<input mdInput type="text" placeholder="Clearable input" [(ngModel)]="value"/>
<md-icon mdSuffix *ngIf="value" (click)="value=''">close</md-icon>
Copy link
Member

Choose a reason for hiding this comment

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

Should be an md-icon-button for a11y

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So actually... md-icon-button doesn't really work well as a suffix currently. It's too tall and it causes the placeholder and input text to be misaligned. Filed #4382 to fix this

@mmalerba
Copy link
Contributor Author

icon-buttons are supported inside inputs now, updated example

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn
Copy link
Member

jelbourn commented Jul 5, 2017

Needs rebase

@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker pr: merge safe and removed pr: needs rebase labels Jul 5, 2017
@mmalerba mmalerba merged commit 05302b8 into angular:master Jul 5, 2017
amcdnl pushed a commit to amcdnl/material2 that referenced this pull request Jul 8, 2017
* docs(input): add example of a clearable input

* use icon button
@mmalerba mmalerba deleted the input-examp branch April 3, 2018 15:18
@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 8, 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.

mdInput clear input button
3 participants