fix(#3964): mark Angular input/textarea as touched on blur only#4079
Open
Spark450 wants to merge 1 commit into
Open
fix(#3964): mark Angular input/textarea as touched on blur only#4079Spark450 wants to merge 1 commit into
Spark450 wants to merge 1 commit into
Conversation
|
Preview links
Built from commit d482353. Previews are removed automatically when this PR closes. |
0e45bbe to
227c116
Compare
Spark450
commented
Jun 19, 2026
| const detail = { ...(e as CustomEvent<GoabInputOnKeyPressDetail>).detail, event: e }; | ||
| this.onKeyPress.emit(detail); | ||
|
|
||
| this.fcTouched?.(); |
Collaborator
Author
There was a problem hiding this comment.
@vanessatran-ddi not sure if this should have been removed?
Collaborator
There was a problem hiding this comment.
Yes this should be removed.
Collaborator
Author
There was a problem hiding this comment.
Confirmed, leaving this removed. The redundant fcTouched call was the same touch trigger as markAsTouched, which now runs on blur only.
227c116 to
57110d5
Compare
ArakTaiRoth
reviewed
Jun 19, 2026
| NgModel, | ||
| ReactiveFormsModule, | ||
| } from "@angular/forms"; | ||
| import { ViewChild } from "@angular/core"; |
Collaborator
There was a problem hiding this comment.
This should be imported on line 3, where we already import other stuff from @angular/core
Collaborator
Author
There was a problem hiding this comment.
Done, consolidated ViewChild into the existing @angular/core import.
| NgModel, | ||
| ReactiveFormsModule, | ||
| } from "@angular/forms"; | ||
| import { ViewChild } from "@angular/core"; |
Collaborator
Author
There was a problem hiding this comment.
Done, same fix here.
vanessatran-ddi
approved these changes
Jun 19, 2026
Reactive FormControl validation using .touched fired as soon as a user tabbed into the field, because the Angular wrappers called markAsTouched on focus, change, and keypress. Touched should mean entered and then left, so markAsTouched now runs only on blur. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
57110d5 to
d482353
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before (the change)
Using
.touchedon a reactiveFormControlfor validation triggered as soon as a user tabbed into agoab-input(orgoab-textarea). The Angular wrappers calledmarkAsTouchedon focus, change, and keypress, so the error state appeared before the user had interacted and left the field.After (the change)
markAsTouchedruns only on blur, matching the definition of touched: entered and then left.markAsTouchedfrom_onChange,_onKeyPress, and_onFocus(also removed the redundantfcTouchedcall in_onKeyPress); added it to_onBlur.markAsTouchedfrom_onChangeand_onKeyPress; the existing_onBlurcall remains.This is an Angular wrapper only change.
markAsTouchedis part of the AngularControlValueAccessorintegration, so the Svelte source and React wrapper are unaffected.Make sure that you've checked the boxes below before you submit the PR
Steps needed to test
3964bug page.lastName.touched/bio.touchedstayfalseon focus, change, and keypress, and flip totrueon blur.Fixes #3964
🤖 Generated with Claude Code