Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .agents/skills/add-component-property/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public items: Array<Item> = [];
- Objects and arrays get `attribute: false` and are never reflected.
- Spell out the attribute for multi-word properties and HTML look-alikes
(`readOnly` → `readonly`).
- A property that writes its own attribute, without `reflect: true`, gets `@reflect` after
`@attr`. Then the manifest shows it as reflected.
- A read-only value is a getter, not a `readonly @property`.

### 2. Write the description
Expand Down Expand Up @@ -106,6 +108,11 @@ In a form-associated control, a property that is part of constraint validation (
`_revalidate` config (`onChange: ({ host }) => host._validate()`) as
`src/components/input/input.ts` does.

The browser reads the `readonly` attribute of a form-associated control at once: a control
with it is not validated. Declare `readOnly` with
`@property({ type: Boolean, attribute: 'readonly' })` and `@coercedProperty(reflectReadOnly)`
from `#internals/mixins/forms/associated.js`, not with `reflect: true`, and add `@reflect`.

### 4. Add tests

Test the default value and a programmatic change after `elementUpdated()`. Test the attribute
Expand Down
11 changes: 8 additions & 3 deletions .github/CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ declare global {
- Override `requestUpdate()` only when a reaction cannot wait for the next update, also for
a property of a base class. Lit calls it from the setter with the name and the old value.
Call `super.requestUpdate()` first, and compare the value with the old value. The form
mixin submits the form value again there, and the radio moves to the group of a new `name`.
mixin writes the `name` attribute there and submits the form value again. The radio
moves to the group of a new `name`.
- Export a new component from `src/index.ts`, in alphabetical order:

```ts
Expand Down Expand Up @@ -730,8 +731,9 @@ A parser, converter or serializer that takes user or stored input also gets prop

Keep the field initializer. It gives the default value, and `onChange` does not run for it.
Use hand-written accessors only for a computed getter or for storage outside the instance.
To share a config between properties, put it in a static field, as
`IgcInputComponent._revalidate` does.
To share a config between the properties of one class, put it in a static field, as
`IgcInputComponent._revalidate` does. To share a config between classes, export it from
a module, as `reflectReadOnly` in `#internals/mixins/forms/associated.js` does.

## Custom Events

Expand Down Expand Up @@ -1042,6 +1044,9 @@ edits.
*/
```

- Some properties write their own attribute and do not use the `reflect` option of
`@property`. Put `@reflect` after `@attr` on them, so the manifest shows them as reflected.
Examples are `name`, `disabled` and `readOnly` of the form controls.
- A deprecated member uses this format:
``@deprecated since [SemVer]. Use the `[new API]` [type] instead.``

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- A year spin stops at year 9999 and at year 1, and a year outside them, such as one set from code, only moves toward them. Before, a spin past year 9999 gave a five digit year that did not fit the input.
- A `prompt` that is also a separator of the input format no longer makes a typed date incomplete. Examples are `-` with `yyyy-MM-dd`, and `-` with the ` - ` of the date range picker. Before, the `igcInput` detail of a complete date was `null`, and an arrow key or a spin started again from today.
- Ctrl + Arrow Left and Ctrl + Arrow Right stop at each date part in an input format without separators, such as `yyyyMMdd`, and do not stop inside a separator of more than one character, such as `, `. Before, the date time input went to the start or the end of the input, and the single input of the date range picker skipped a part.
- #### Date picker, Date range picker, Date time input, Input, Mask input, Rating, Textarea
- A change of `readOnly` updates the `readonly` attribute at once, as for a native control, so constraint validation follows it at once. Before, the attribute changed in the next render. Until then, a required empty control that became read-only still blocked a form submission.
- #### Date picker, Date time input
- `stepUp(DatePart.AmPm)` and `stepDown(DatePart.AmPm)` read AM or PM from the value. Before, while the input did not have focus and the display format was different from the input format, they read the display text, so they did nothing or switched only from PM to AM.
- #### Date range picker
Expand All @@ -111,6 +113,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- The selected files are submitted under the current `name`. Before, a change of `name` kept them under the old name, and a `name` set after the selection submitted no files.
- #### Form controls
- A change of the `value` or `checked` attribute keeps the control pristine, so a later `defaultValue` or `defaultChecked` still sets the value, as for a native control.
- A change of `name` updates the `name` attribute at once, as for a native control, so the form data takes the new name. Before, a control that submits a string kept the old name until the next render. Such controls include the input, the select and a single selection combo. A `null` or `undefined` name also removes the attribute at once.
- #### Input, Textarea
- `stepUp()`, `stepDown()` and `setRangeText()` no longer clear the value when you call them before the first render.
- #### Mask input
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defineComponents(IgcCheckboxComponent);
The `checked` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-color-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ defineComponents(IgcColorPickerComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-combo.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ defineComponents(IgcComboComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defineComponents(IgcDatePickerComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-date-range-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defineComponents(IgcDateRangePickerComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
4 changes: 2 additions & 2 deletions api-reference/igc-date-time-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defineComponents(IgcDateTimeInputComponent);
state lives in the masked text and is committed - together with an `igcChange`
event - when the edit is committed on blur. Use the `igcInput` event to observe
the value as it is being typed.
- `readOnly`: `boolean`. Default: `false`. Attribute: `readOnly`, reflected.
- `readOnly`: `boolean`. Default: `false`. Attribute: `readonly`, reflected.
Whether the control is read-only. The user cannot change its value.
- `mask`: `string`. Attribute: `mask`.
The mask pattern of the component.
Expand All @@ -37,7 +37,7 @@ defineComponents(IgcDateTimeInputComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-file-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defineComponents(IgcFileInputComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
4 changes: 2 additions & 2 deletions api-reference/igc-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineComponents(IgcInputComponent);
The value of the control.
- `type`: `'number' | 'text' | 'email' | 'password' | 'search' | 'tel' | 'url'`. Default: `'text'`. Attribute: `type`, reflected.
The type of the control.
- `readOnly`: `boolean`. Default: `false`. Attribute: `readOnly`, reflected.
- `readOnly`: `boolean`. Default: `false`. Attribute: `readonly`, reflected.
Whether the control is read-only.
- `inputMode`: `string`. Attribute: `inputmode`.
A hint to the browser for which virtual keyboard layout to display.
Expand Down Expand Up @@ -55,7 +55,7 @@ defineComponents(IgcInputComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
4 changes: 2 additions & 2 deletions api-reference/igc-mask-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defineComponents(IgcMaskInputComponent);
The mask pattern of the control.
- `prompt`: `string`. Default: `'_'`. Attribute: `prompt`.
The prompt symbol to use for unfilled parts of the mask pattern.
- `readOnly`: `boolean`. Default: `false`. Attribute: `readOnly`, reflected.
- `readOnly`: `boolean`. Default: `false`. Attribute: `readonly`, reflected.
Whether the control is read-only. The user cannot change its value.
- `selectionStart`: `number`. Read-only. No attribute.
The offset of the start of the text selection, in UTF-16 code units.
Expand All @@ -41,7 +41,7 @@ defineComponents(IgcMaskInputComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defineComponents(IgcRadioComponent);
The `checked` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-rating.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defineComponents(IgcRatingComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defineComponents(IgcSelectComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defineComponents(IgcSwitchComponent);
The `checked` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
2 changes: 1 addition & 1 deletion api-reference/igc-textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defineComponents(IgcTextareaComponent);
new default also sets the value. The `value` attribute also sets it.
- `name`: `string`. Attribute: `name`, reflected.
The name of the control, submitted with the form data.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`.
- `disabled`: `boolean`. Default: `false`. Attribute: `disabled`, reflected.
Whether the control is disabled. A disabled control is not validated,
and the form does not submit its value.
- `invalid`: `boolean`. Default: `false`. Attribute: `invalid`.
Expand Down
3 changes: 0 additions & 3 deletions public-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,6 @@
"placeholder": "string",
"prompt": "string",
"readonly": "boolean",
"readOnly": "boolean",
"required": "boolean",
"spin-loop": "boolean",
"value": "Date | null"
Expand Down Expand Up @@ -2362,7 +2361,6 @@
"pattern": "string | undefined",
"placeholder": "string",
"readonly": "boolean",
"readOnly": "boolean",
"required": "boolean",
"step": "number | undefined",
"type": "InputType ('email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url')",
Expand Down Expand Up @@ -2577,7 +2575,6 @@
"placeholder": "string",
"prompt": "string",
"readonly": "boolean",
"readOnly": "boolean",
"required": "boolean",
"value": "string",
"value-mode": "MaskInputValueMode ('raw' | 'withFormatting')"
Expand Down
1 change: 1 addition & 0 deletions scripts/build-typedoc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async function main() {
'@cssproperty',
'@cssstate',
'@attr',
'@reflect',
],
suppressCommentWarningsInDeclarationFiles: true,
name: 'Ignite UI for Web Components',
Expand Down
1 change: 1 addition & 0 deletions src/components/checkbox/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ This directory hosts two form-associated components that share the same base imp
| 11 | 2026-11-11 | <kbd>Enter</kbd> submits only through the first submit button of the form, as for a native checkbox, and not after a canceled `keypress` |
| 12 | 2026-11-18 | A change of the `checked` attribute or of `value` keeps the control pristine, as for a native checkbox |
| 13 | 2026-11-20 | Only a change by the user animates the checkbox and the switch; a change from code and the first render show at once; no transitions with reduced motion. The Material switch thumb moves with a transition, not with keyframes; while a change shows at once, the transitions that the app sets on parts and slotted elements stop too |
| 14 | 2026-11-25 | `name` updates its attribute at once |

## Overview

Expand Down
1 change: 1 addition & 0 deletions src/components/color-picker/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
| 17 | 2026-11-18 | In input mode, the text input shows only the invalid state of the picker, and reports the validity of the picker |
| 18 | 2026-11-23 | A disabled picker stays closed; the shared disabled popup suite |
| 19 | 2026-11-20 | In input mode, a color that the user picks animates the input; a value from code shows at once |
| 20 | 2026-11-25 | `name` updates its attribute at once |

## Overview

Expand Down
3 changes: 1 addition & 2 deletions src/components/combo/combo-form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ describe('Combo', () => {

it('submits the value under a new name (single)', async () => {
spec.setProperties({ singleSelect: true });
// A string value goes under the `name` attribute, which the update reflects.
await spec.rename('renamed', true);
await spec.rename('renamed');

spec.assertSubmitHasValues(['BG01']);
});
Expand Down
1 change: 1 addition & 0 deletions src/components/combo/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
| 35 | 2026-11-19 | Test scenarios: in single selection, a pick or a clear that the app cancels after the user types shows the kept selection again, and the clear button clears a value that has no record. The selection model keeps `value` in sync; the behavior does not change |
| 36 | 2026-11-23 | A disabled combo stays closed; the shared disabled popup suite |
| 37 | 2026-11-20 | A selection by the user animates the option checkboxes; a value from code, a new `data`, a reused row and a value that an `igcChange` handler keeps show at once |
| 38 | 2026-11-25 | `name` updates its attribute at once |

## Overview

Expand Down
5 changes: 4 additions & 1 deletion src/components/date-picker/date-picker.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import type { IgcCalendarResourceStrings } from '#internals/i18n/EN/calendar.resources.js';
import type { UnpackCustomEvent } from '#internals/mixins/event-emitter.js';
import { FormAssociatedRequiredMixin } from '#internals/mixins/forms/associated-required.js';
import { reflectReadOnly } from '#internals/mixins/forms/associated.js';
import type { FormValue } from '#internals/mixins/forms/form-value.js';
import { renderSlottedIcon } from '#internals/templates/slotted-icon.js';
import { asArray, firstOf } from '#internals/utils/arrays.js';
Expand Down Expand Up @@ -295,9 +296,11 @@ export abstract class IgcDatePickerBaseComponent<
/**
* Whether the control is read-only. The user cannot change the value or open the calendar.
* @attr readonly
* @reflect
* @default false
*/
@property({ type: Boolean, reflect: true, attribute: 'readonly' })
@property({ type: Boolean, attribute: 'readonly' })
@coercedProperty(reflectReadOnly)
public readOnly = false;

/**
Expand Down
1 change: 1 addition & 0 deletions src/components/date-picker/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
| 22 | 2026-11-23 | A disabled picker stays closed; the shared disabled popup suite |
| 23 | 2026-11-20 | A date that the user picks animates the input; a value from code, also from an `igcChange` handler, shows at once |
| 24 | 2026-11-25 | The calendar selects a complete typed date, keeps the last selection while the date is incomplete or invalid, and clears it for an empty input; the calendar shows the value again when the edit ends; the input and change events of slotted content go on to the application |
| 25 | 2026-11-25 | `name` and `readOnly` update their attributes at once |

## Overview

Expand Down
Loading