Skip to content

fix(forms): update the name and readonly attributes at once - #2652

Merged
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/form-attribute-writes
Nov 25, 2026
Merged

rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/form-attribute-writes

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

Description

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.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed
  • If I changed the public API on purpose, or its JSDoc, I have run npm run public-api:update and committed public-api.json and api-reference/
  • I have added a CHANGELOG.md entry under [Unreleased]

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.
Copilot AI balanced review requested due to automatic review settings November 25, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@rkaraivanov
rkaraivanov merged commit 62f5b07 into master Nov 25, 2026
11 checks passed
@rkaraivanov
rkaraivanov deleted the rkaraivanov/form-attribute-writes branch November 25, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants