Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(autocomplete): form control being marked as touched too early when clicking on an option #11908

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

Open
crisbeto wants to merge 1 commit into angular:main
base: main
Choose a base branch
Loading
from crisbeto:11903/autocomplete-mark-as-touched

Conversation

Copy link
Member

@crisbeto crisbeto commented Jun 24, 2018

Currently we mark the autocomplete form control as touched on every blur event. This can be an issue for the case where a control is being validated on blur, because the input becomes blurred as soon as the user has their pointer down on something else (e.g. one of the options). This will cause validation to run before the value has been assigned. With these changes we switch to marking the control as touched once the panel has been closed.

Fixes #11903.

Totati reacted with heart emoji
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 24, 2018
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@josephperrott josephperrott added pr: lgtm action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jun 26, 2018
@crisbeto crisbeto force-pushed the 11903/autocomplete-mark-as-touched branch from 0c7b057 to 707905c Compare January 4, 2019 16:04
@mmalerba mmalerba added aaa and removed aaa labels Apr 25, 2019
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 30, 2019
@crisbeto crisbeto force-pushed the 11903/autocomplete-mark-as-touched branch from 707905c to 078ece6 Compare July 19, 2019 19:45
@crisbeto crisbeto force-pushed the 11903/autocomplete-mark-as-touched branch from 078ece6 to 98c9a4a Compare August 25, 2019 14:05
@crisbeto crisbeto force-pushed the 11903/autocomplete-mark-as-touched branch from 98c9a4a to d0b8dd5 Compare January 4, 2020 15:28
@crisbeto crisbeto force-pushed the 11903/autocomplete-mark-as-touched branch from d0b8dd5 to 7cbe36c Compare August 29, 2020 15:12
...early when clicking on an option
Currently we mark the autocomplete form control as touched on every blur event. This can
be an issue for the case where a control is being validated on blur, because the input
becomes blurred as soon as the user has their pointer down on something else
(e.g. one of the options). This will cause validation to run before the value has been
assigned. With these changes we switch to marking the control as touched once the
panel has been closed.
Fixes angular#11903.
@crisbeto crisbeto force-pushed the 11903/autocomplete-mark-as-touched branch from 7cbe36c to 8d0658d Compare October 12, 2020 21:39
Copy link
Contributor

annieyw commented Oct 14, 2020
edited by josephperrott
Loading

Failing a number of google3 tests because tests were testing for errors on blur. Will probably have to individually change the tests to actually touch the form control.

@andrewseguin andrewseguin added needs rebase and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Dec 29, 2021
@andrewseguin andrewseguin removed the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Mar 28, 2022
@josephperrott josephperrott added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed needs rebase labels Nov 16, 2022
@josephperrott josephperrott requested a review from a team as a code owner December 18, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@josephperrott josephperrott josephperrott left review comments

@amysorto amysorto Awaiting requested review from amysorto amysorto is a code owner automatically assigned from angular/components-googlers

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Too early validation when using MatAutocomplete and "updateOn: 'blur'"

AltStyle によって変換されたページ (->オリジナル) /