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): reopening when clicking an option in IE #5172

Merged

Conversation

crisbeto
Copy link
Member

Fixes an issue that caused IE to reopen the autocomplete panel if the user clicks to select an item. It seems that IE can delay refocusing the input after the panel has been closed, which causes the focus handler to reopen it.

Fixes #5165.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 16, 2017
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, apply label when typo is fixed.

@@ -78,7 +78,9 @@ export function getMdAutocompleteMissingPanelError(): Error {
'[attr.aria-activedescendant]': 'activeOption?.id',
'[attr.aria-expanded]': 'panelOpen.toString()',
'[attr.aria-owns]': 'autocomplete?.id',
'(focus)': 'openPanel()',
// Note: we use `focusin`, as opposed to `focus`, in order to open the panel
// a little earlier. This avoids issues where IE delays the focusing the input.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: IE delays the focusing the input -> IE delays the focusing of the input

@kara kara removed their assignment Jun 16, 2017
Fixes an issue that caused IE to reopen the autocomplete panel if the user clicks to select an item. It seems that IE can delay refocusing the input after the panel has been closed, which causes the focus handler to reopen it.

Fixes angular#5165.
@crisbeto crisbeto force-pushed the 5165/ie-autocomplete-close-on-click branch from 08c7ae0 to a763fd6 Compare June 17, 2017 12:20
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jun 17, 2017
@jelbourn jelbourn added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Jun 20, 2017
@jelbourn
Copy link
Member

Caretaker note: one team has a test utility that fires a fake focus event and tests that the autocomplete is open; changing it to also do focusin fixes the test for this PR

@jelbourn jelbourn merged commit fe31210 into angular:master Jun 22, 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 merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autocomplete panel doesn't close when an option click
4 participants