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(autocomplete): add value support #2516

Merged
merged 1 commit into from
Jan 19, 2017

Conversation

kara
Copy link
Contributor

@kara kara commented Jan 4, 2017

Autocomplete is WIP. This is a small piece to add value population.

Note: The placeholder animation will still happen when setting the value. This will be fixed in a later PR once floating placeholders are more configurable in input.

@kara kara requested a review from jelbourn January 4, 2017 02:54
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 4, 2017
@kara kara force-pushed the autocomplete-forms branch 6 times, most recently from c541077 to 30e83a9 Compare January 8, 2017 00:12
@kara kara added in progress This issue is currently in progress and removed pr: needs review labels Jan 8, 2017
@kara kara added pr: needs review and removed in progress This issue is currently in progress labels Jan 9, 2017
@kara kara force-pushed the autocomplete-forms branch 4 times, most recently from b8cb2df to f431e49 Compare January 11, 2017 23:20
@jelbourn jelbourn self-assigned this Jan 13, 2017
</md-card>

<md-card>
<div>TD value (currentState): {{ currentState }}</div>
Copy link
Member

Choose a reason for hiding this comment

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

TD?

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 to "template-driven" for clarity

*/
private _subscribeToClosingActions(): void {
this.autocomplete.options.changes
.startWith(null)
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 explaining what this does? I don't know what startWith(null) is for or what switchMap does

*/
private _setValueAndClose(event: MdOptionSelectEvent | null): void {
if (event) {
// TODO(kara): revisit animation once floating placeholder is toggle-able
Copy link
Member

Choose a reason for hiding this comment

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

TODO probably isn't necessary any more

expect(fixture.componentInstance.stateCtrl.dirty)
.toBe(false, `Expected control to stay pristine if value is set programmatically.`);
});

Copy link
Member

Choose a reason for hiding this comment

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

Should there be any tests for touched state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should be tested by the forms module and/or mdInput. The autocomplete doesn't actually touch those events, so seems duplicative to test here.

@kara kara assigned kara and unassigned jelbourn Jan 13, 2017
@kara kara force-pushed the autocomplete-forms branch 2 times, most recently from 78a5be9 to e21a8e1 Compare January 13, 2017 19:05
@kara
Copy link
Contributor Author

kara commented Jan 13, 2017

@jelbourn Comments addressed!

@kara kara assigned jelbourn and unassigned kara Jan 13, 2017
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 jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Jan 13, 2017
@mmalerba mmalerba merged commit 5def001 into angular:master Jan 19, 2017
kara added a commit to kara/material2 that referenced this pull request Jan 20, 2017
@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.

4 participants