Skip to content

feat(autocomplete): add isOpen attribute #7149

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 1 commit into from
Sep 29, 2017

Conversation

josephperrott
Copy link
Member

For #5881

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 18, 2017
@@ -57,6 +57,11 @@ export class MdAutocomplete implements AfterContentInit {
/** Whether the autocomplete panel should be visible, depending on option length. */
showPanel = false;

_isOpen: boolean = false;
Copy link
Member

@crisbeto crisbeto Sep 18, 2017

Choose a reason for hiding this comment

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

I'm not sure we need this extra flag. isOpen should be the same as this.showPanel && this.options.length > 0.

Copy link
Member Author

Choose a reason for hiding this comment

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

That was my initial thought as well, however, showPanel is not set to false on blur, which prevents it from working that way.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

Cool, also a final nit: can you add a doc string to the isOpen getter so it shows up in the docs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, not sure how I deleted the doc line I had for it.

@@ -66,19 +66,6 @@
</md-card>
</div>

<md-autocomplete #reactiveAuto="mdAutocomplete" [displayWith]="displayFn">
Copy link
Member

Choose a reason for hiding this comment

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

Why were these removed from the demo?

Copy link
Member Author

Choose a reason for hiding this comment

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

They are duplicates of the same elements above.

It look slike we had 5 <md-autocomplete>s for 3 [mdAutocompleteTrigger]s

@@ -57,6 +57,11 @@ export class MdAutocomplete implements AfterContentInit {
/** Whether the autocomplete panel should be visible, depending on option length. */
showPanel = false;

_isOpen: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 18, 2017
- Add isOpen attribute to `MdAutocomplete` component.
@andrewseguin andrewseguin merged commit c5c96d9 into angular:master Sep 29, 2017
@josephperrott josephperrott deleted the autocomplete-is-open branch October 16, 2017 16:10
@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 7, 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