Repository navigation
fix(forms): update the name and readonly attributes at once - #2652
Merged
Merged
Conversation
A change of `name` now writes the `name` attribute at once, as on a native control. Before, a control that submits a string, such as the input, the select or a single selection combo, used the old name in the form data until the next render. A null or undefined name removes the attribute. A change of `readOnly` now writes the `readonly` attribute at once, so constraint validation follows it. Before, a required empty control that became read-only blocked a form submission until the next render. This applies to the date picker, date range picker, date time input, input, mask input, rating and textarea. The attribute write does not set the property again, so the property keeps the value that code set, as with `reflect: true`. A new `@reflect` JSDoc tag keeps these properties marked as reflected in the manifest.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the synchronous form-property reflection changes.
No open issues 🎉
What changed in this PR
This PR makes Ignite UI form controls reflect name and readOnly changes immediately, so form submission and constraint validation no longer wait for a render.
Changes:
- Adds synchronous attribute writes while preserving assigned property values.
- Adds regression tests for submission names, read-only validation, attribute writes, and upgrades.
- Updates reflection metadata, API documentation, component revision histories, and contributor guidance.
| File | Description |
|---|---|
src/internals/testing/helpers.spec.ts |
Adds an attribute-write counting helper. |
src/internals/mixins/mask-behavior.ts |
Applies immediate read-only reflection to masked controls. |
src/internals/mixins/forms/types.ts |
Marks name and disabled as reflected. |
src/internals/mixins/forms/associated.ts |
Implements immediate reflection without resetting properties. |
src/internals/mixins/form-submission.spec.ts |
Tests immediate name changes and edge cases. |
src/internals/mixins/form-read-only.spec.ts |
Tests read-only reflection and immediate validation changes. |
src/components/textarea/textarea.ts |
Uses shared immediate read-only reflection. |
src/components/textarea/spec.md |
Records immediate name and read-only reflection. |
src/components/slider/spec.md |
Records immediate name reflection. |
src/components/select/spec.md |
Records immediate name reflection. |
src/components/rating/spec.md |
Records reflection changes and corrects disabled metadata. |
src/components/rating/rating.ts |
Uses shared immediate read-only reflection. |
src/components/radio/spec.md |
Records immediate name reflection. |
src/components/mask-input/spec.md |
Records immediate name and read-only reflection. |
src/components/input/spec.md |
Records immediate name and read-only reflection. |
src/components/input/input.ts |
Uses shared immediate read-only reflection. |
src/components/file-input/spec.md |
Records immediate name reflection. |
src/components/date-time-input/spec.md |
Records immediate name and read-only reflection. |
src/components/date-range-picker/spec.md |
Records immediate name and read-only reflection. |
src/components/date-picker/spec.md |
Records immediate name and read-only reflection. |
src/components/date-picker/date-picker.base.ts |
Applies immediate read-only reflection to both pickers. |
src/components/combo/spec.md |
Records immediate name reflection. |
src/components/combo/combo-form.spec.ts |
Removes the render wait from the rename helper call. |
src/components/color-picker/spec.md |
Records immediate name reflection. |
src/components/checkbox/spec.md |
Records immediate name reflection. |
scripts/build-typedoc.mjs |
Recognizes the @reflect JSDoc tag. |
public-api.json |
Removes duplicate camel-case read-only attribute entries. |
CHANGELOG.md |
Documents submission and validation timing fixes. |
api-reference/igc-textarea.md |
Marks disabled as reflected. |
api-reference/igc-switch.md |
Marks disabled as reflected. |
api-reference/igc-select.md |
Marks disabled as reflected. |
api-reference/igc-rating.md |
Marks disabled as reflected. |
api-reference/igc-radio.md |
Marks disabled as reflected. |
api-reference/igc-mask-input.md |
Corrects readonly spelling and disabled reflection metadata. |
api-reference/igc-input.md |
Corrects readonly spelling and disabled reflection metadata. |
api-reference/igc-file-input.md |
Marks disabled as reflected. |
api-reference/igc-date-time-input.md |
Corrects readonly spelling and disabled reflection metadata. |
api-reference/igc-date-range-picker.md |
Marks disabled as reflected. |
api-reference/igc-date-picker.md |
Marks disabled as reflected. |
api-reference/igc-combo.md |
Marks disabled as reflected. |
api-reference/igc-color-picker.md |
Marks disabled as reflected. |
api-reference/igc-checkbox.md |
Marks disabled as reflected. |
.github/CODING_GUIDELINES.md |
Documents immediate reflection, shared configs, and @reflect. |
.agents/skills/add-component-property/SKILL.md |
Adds guidance for manual reflection and read-only properties. |
Review effort: Balanced
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.
Description
A change of
namenow writes thenameattribute at once, as on a native control. Before, a control that submits a string, such as the input, the select or a single selection combo, used the old name in the form data until the next render. A null or undefined name removes the attribute.A change of
readOnlynow writes thereadonlyattribute at once, so constraint validation follows it. Before, a required empty control that became read-only blocked a form submission until the next render. This applies to the date picker, date range picker, date time input, input, mask input, rating and textarea.The attribute write does not set the property again, so the property keeps the value that code set, as with
reflect: true. A new@reflectJSDoc tag keeps these properties marked as reflected in the manifest.Type of Change
Checklist
npm run public-api:updateand committedpublic-api.jsonandapi-reference/CHANGELOG.mdentry under[Unreleased]