fix(inputtext,datepicker): remove unreachable undefined from emit types#8443
Open
YevheniiKotyrlo wants to merge 1 commit intoprimefaces:masterfrom
Open
fix(inputtext,datepicker): remove unreachable undefined from emit types#8443YevheniiKotyrlo wants to merge 1 commit intoprimefaces:masterfrom
YevheniiKotyrlo wants to merge 1 commit intoprimefaces:masterfrom
Conversation
a8c778d to
7229937
Compare
This was referenced Mar 6, 2026
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.
Defect Fixes
Fixes #8441
InputTextandDatePickerdeclare| undefinedin theirupdate:modelValueandvalue-changeemit signatures, but neither component can emitundefinedat runtime. WithstrictTemplates: true, the emitted| undefinedis not assignable to the consumer's ref type, producing 39 false-positive type errors that block adoption ofstrictTemplates.Related: #6041
Reproducer: StackBlitz — run
bun run type-checkin terminal (TS2322 false positive), thenbun run patch && bun run type-check(0 errors)Problem
After this fix,
v-modelcorrectly matches the consumer's type — no error.string | undefinedstringRef<string>Date | ... | undefined | nullDate | ... | nullRef<Date | null>Root cause
InputText: Single emission path —
onInput(event)->writeValue(event.target.value).HTMLInputElement.valueis alwaysstringper HTML spec. Full inheritance chain audited — noresetValue(),clear(), or watcher re-emission exists. No path can emitundefined.DatePicker: All 9 emission paths traced through
updateModel()->writeValue()->$emit(). Clear button emitsnull. Invalid text input throws (no emission). Range mode mapsundefined->nullbefore callingformatDateTime. 7 edge cases pressure-tested (empty input, invalid text, range incomplete, multi deselect).undefinedis never passed towriteValue().Changes
inputtext/InputText.d.ts:string | undefined->string(2 emit signatures)datepicker/DatePicker.d.ts: remove| undefined, preserve| null(2 emit signatures)Scope / Impact
strictTemplatesadoptionVerification
stringundefinedvue-tsc --noEmitwithstrictTemplates