Repository navigation
[2.1] Fixes #37771: clear React Aria controlled props with null, and lint for it - #37781
Conversation
…or it (#37772) * Fixes #37771: keep the async query builder select controlled when cleared OMSelectWidget passed selectedKey={undefined} to Select.ComboBox for an empty value, which hands the selection to React Aria. Clearing the input then looped between its state and the query builder's until React threw "Maximum update depth exceeded". Pass null, as the sync Select already does. * Fixes #37771: clear React Aria controlled props with null, and lint for it The same undefined fallback that crashed the async select also sat on the query builder field select, the form radio widget, the service environment select and the service agents sub-tabs. Each now passes its empty controlled value. A new ESLint rule, openmetadata-ui-patterns/no-undefined-controlled-prop, fails a literal undefined fallback on a controlled prop, and the decision record states the rule for the cases the lint cannot see. * Format the no-undefined-controlled-prop rule and its tests (cherry picked from commit 8a03f70)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium riskChanging React Aria controlled-value fallbacks to null across UI components could affect selection and reset behavior where wrappers expect undefined. Backports the fix for clearing async query builder selects, which previously crashed with "Maximum update depth exceeded". Empty values now pass VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #37771
Backport of #37772 to
2.1. A clean cherry-pick of 8a03f70.The automated backport for #37772 targeted only
2.0(the release endpoint lists["2.0"]), so this raises the2.1one by hand.Clearing an async query builder select value in one go (Cmd+Delete, or select-all + Delete) crashed the page with "Maximum update depth exceeded".
OMSelectWidgetfell back toselectedKey={undefined}for an empty value, which React Aria reads as uncontrolled; its own selection then fought the query builder's until React gave up. The PR passesnullthere and in the four other places that had the same fallback (OMFieldSelect,CoreRadioWidget,ServiceAttributesCard, the service Agents sub-tabs). It adds the ESLint ruleopenmetadata-ui-patterns/no-undefined-controlled-prop(error) andADR:2026-11-13-react-aria-controlled-props-are-cleared-with-null-not-undefined.Type of change:
Tests:
Run on
2.1at10e33cc07af(this branch's base) with the commits applied:openmetadata-uiandopenmetadata-ui-core-componentssources on2.1: 0 findings in 2,988 files, so enabling it at error does not fail this branch's lint.eslint-rules/openmetadata-ui-patterns.test.mjs: 58/58 pass.utils/queryBuilderWidgets,Settings/Services/ServiceAttributes,common/FormBuilderV1: 145/145 pass, includingOMSelectWidget›keeps the async select controlled when its value is cleared.Browser verification (before/after of the crash, the field select, the Agents sub-tabs) is in #37772.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.docs/decisions/2026-11-13-react-aria-controlled-props-are-cleared-with-null-not-undefined.mdfrom Fixes #37771: clear React Aria controlled props with null, and lint for it #37772.🤖 Generated with Claude Code