[fields] Remove enableAccessibleFieldDOMStructure behavior#21966
Conversation
siriwatknp
left a comment
There was a problem hiding this comment.
Can you update the merge conflict and I'll review it again.
Just want to make sure that the PickerUIField is up-to-date with master from my earlier PR.
Addressed conflicts. 👌 @flaviendelangle, I've addressed valid concerns in: #21966 (review). |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Code Review: PR #21966 — Remove
|
There was a problem hiding this comment.
Contents directly moved to useField/useFieldRootProps.ts
These were leftovers from the v6/v7 field DOM structure era (removed in mui#21966) where each test rendered twice and called unmount() between renders. Vitest's auto-cleanup (`afterEach(() => cleanup())` registered in `@mui/internal-test-utils/setupVitest`) already handles teardown between tests, so the trailing calls are redundant. The three `testFormat` helpers in the Desktop picker field tests are intentionally left alone since they render multiple times within a single it() block and the intermediate unmount is load-bearing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Removes the
enableAccessibleFieldDOMStructureprop from all pickers and field components. The accessible DOM structure (section-basedPickersTextField) introduced in v7 is now the only supported mode — the legacy v6 plain<input>fallback is no longer available.What changed
useFieldV6TextFieldhook and all v6 legacy field rendering codeTEnableAccessibleFieldDOMStructuregeneric parameter fromPickerManager, all field/picker types, hooks, and componentsuseField,useFieldState,buildSectionsFromFormat,getSectionOrder) by removing all conditional v6/v7 branchinguseFieldV7TextFieldintouseFieldanduseFieldRootHandleKeyDownintouseFieldRootProps(no longer need separate files)createDateStrForV6InputFromSections/getV6InputValueFromSectionsfrom value managersgetV7HiddenInputValueFromSections→getHiddenInputValueFromSectionsUseDateManagerParametersandUseDateTimeManagerParametersinterfaces (were empty after prop removal)NonAccessibleDOMStructurevariantsBrowserV7*andMaterialV7*demo files to drop "V7" suffixexpectFieldValueV7→expectFieldValueandv7Response→responsein test utilitiesremove-enable-accessible-field-dom-structurecodemod (v9.0.0) that strips the prop from all JSX usages; included inpreset-safe