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

fix(autocomplete): placeholder not animating on focus #3992

Merged
merged 1 commit into from Aug 23, 2017

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 9, 2017

Fixes the placeholder not being animated on focus.

Note: The _handleFocus and openPanel methods do pretty much the same (aside from the extra boolean), but I wanted to avoid having to pass the $event to openPanel since the event isn't really relevant to the API for opening the autocomplete programmatically.

Fixes #5755.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 9, 2017
@jelbourn jelbourn requested a review from kara April 10, 2017 15:49
@jelbourn
Copy link
Member

@kara LGTM, but you should take a look

Screenshot failure seems unrelated (I think a gold didn't update when I approved and merged a previous PR).

if (this._inputContainer && this._inputContainer.floatPlaceholder === 'auto') {
this._inputContainer.floatPlaceholder = 'always';
if (!shouldAnimate) {
this._inputContainer.floatPlaceholder = 'always';
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason why we set the placeholder to 'always' in this fashion is to avoid the placeholder jumping when an option is selected by the mouse (when previously no option was selected). Testing it locally, it looks like this change causes the placeholder to jump again. Can you take a look?

Copy link
Member Author

@crisbeto crisbeto Apr 10, 2017

Choose a reason for hiding this comment

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

I see what you mean, but in this case the only solution that both animates on focus and doesn't jump when clicking, would be to listen to the transitionend event on the placeholder and adding always after it is done. Wouldn't that be too much trouble for something this simple?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give it a shot? We can't really merge in a regression, especially for something as important as option selection.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had a PoC running, but it wasn't particularly elegant. I'll try to do something cleaner.

@kara kara assigned crisbeto and unassigned jelbourn and kara Apr 10, 2017
@jelbourn jelbourn added in progress This issue is currently in progress and removed pr: needs review labels Apr 14, 2017
@crisbeto crisbeto force-pushed the autocomplete-placeholder-animate branch 2 times, most recently from e8a0d88 to 140f403 Compare April 18, 2017 19:09
@crisbeto crisbeto added pr: needs review and removed in progress This issue is currently in progress labels Apr 18, 2017
@crisbeto crisbeto assigned kara and unassigned crisbeto Apr 18, 2017
@crisbeto
Copy link
Member Author

@kara I've reworked this one as discussed, can you take another look? Note that the CI failure seems to be due to Saucelabs timing out.

@crisbeto
Copy link
Member Author

@kara I've updated this one to work against the current master. Can you take another look?

@kara
Copy link
Contributor

kara commented Aug 15, 2017

@crisbeto I am the worst. Can you re-base again?

@kara kara assigned crisbeto and unassigned kara Aug 15, 2017
@crisbeto crisbeto force-pushed the autocomplete-placeholder-animate branch from 43d46f6 to f7a8f69 Compare August 20, 2017 12:18
Fixes the placeholder not being animated on focus.

**Note:** The `_handleFocus` and `openPanel` methods do pretty much the same (aside from the extra boolean), but I wanted to avoid having to pass the `$event` to `openPanel` since the event isn't really relevant to the API for opening the autocomplete programmatically.

Fixes angular#5755.
@crisbeto crisbeto force-pushed the autocomplete-placeholder-animate branch from f7a8f69 to ffd7e25 Compare August 20, 2017 12:20
@crisbeto crisbeto assigned kara and unassigned crisbeto Aug 20, 2017
@crisbeto
Copy link
Member Author

Rebased and set up to work with the form field. Can you take a look @kara?

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM

@kara kara removed their assignment Aug 22, 2017
@kara kara added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Aug 22, 2017
@kara kara merged commit ff54969 into angular:master Aug 23, 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.

Floating label for autocomplete does not animate on focus
4 participants