Skip to content

Add validateOptionExists flag to LookupField#1298

Merged
mstijak merged 1 commit into
masterfrom
feat/1271-lookupfield-validate-option-exists
May 29, 2026
Merged

Add validateOptionExists flag to LookupField#1298
mstijak merged 1 commit into
masterfrom
feat/1271-lookupfield-validate-option-exists

Conversation

@mstijak
Copy link
Copy Markdown
Member

@mstijak mstijak commented May 29, 2026

Summary

  • Adds opt-in validateOptionExists flag to LookupField. When enabled and options is an array, the field reports invalidOptionText as a validation error if the stored selection isn't present in options — surfaces stale ids in ValidationGroup.
  • Skipped when options isn't an array (server-driven onQuery/infinite lookups) so loading states don't false-positive.
  • Default is false for back-compat.
  • Adds 6 runtime tests, docs entries on the LookupField page, changelog note, and translations for all 7 standard locales (en-us, de-de, es-es, fr-fr, nl-nl, pt-pt, sr-latn-ba).

Closes #1271

Test plan

  • yarn test — 514 passing
  • tsc --noEmit clean
  • Manual smoke: bind a stale id to a LookupField inside a ValidationGroup with validateOptionExists, confirm the error surfaces and clears after selecting a valid option

When enabled and options is an array, the field reports a validation
error (invalidOptionText) if the stored selection is not present in
the options list. Useful for surfacing stale ids preserved across
sessions. Closes #1271.
@mstijak mstijak merged commit 7818a60 into master May 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add LookupField validation for unavailable values in options based lookup

1 participant