Skip to content

feat(forms): give defaultValue the type of each control - #2653

Merged
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/typed-default-value
Nov 25, 2026
Merged

rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/typed-default-value

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

Description

defaultValue now has the type of the default that each control keeps, in place of unknown. The date controls also accept a string, as value does.

The file input keeps no default: defaultValue is always null, and a form reset always clears the selection. Before, a file list written to defaultValue was submitted after a reset while the control showed no files, and a string was submitted one character per entry.

The manifest now keeps the type of an override. So the API reference gives the date time input value the type Date | null, not T | null.

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Refactoring (code improvements without functional changes)

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]

defaultValue now has the type of the default that each control keeps,
in place of unknown. The date controls also accept a string, as value
does.

The file input keeps no default: defaultValue is always null, and a
form reset always clears the selection. Before, a file list written
to defaultValue was submitted after a reset while the control showed
no files, and a string was submitted one character per entry.

The manifest now keeps the type of an override. So the API reference
gives the date time input value the type Date | null, not T | null.
Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:35

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 remain in the default-value typing, file-reset behavior, and API documentation changes.

No open issues 🎉

What changed in this PR

This PR gives form controls in Ignite UI for Web Components concrete defaultValue types and aligns generated API documentation with those types.

Changes:

  • Adds control-specific defaultValue accessors, with date controls also accepting strings.
  • Ensures file inputs retain no default selection and submit no files after reset, with regression tests.
  • Corrects manifest override types and updates API references, specifications, Storybook metadata, and the changelog.
File Description
stories/​date-time-input.stories.ts Adds date-value metadata and removes the generic-type workaround.
src/​internals/​mixins/​forms/​form-transformers.ts Makes file-input defaults always null.
src/​components/​textarea/​textarea.ts Types defaultValue as string.
src/​components/​slider/​spec.md Aligns default-value documentation with JSDoc.
src/​components/​slider/​slider.ts Types defaultValue as number.
src/​components/​select/​spec.md Documents string | undefined defaults.
src/​components/​select/​select.ts Types defaultValue as string | undefined.
src/​components/​rating/​spec.md Aligns default-value documentation with JSDoc.
src/​components/​rating/​rating.ts Types defaultValue as number.
src/​components/​mask-input/​mask-input.ts Types defaultValue as string.
src/​components/​input/​input.ts Types defaultValue as string.
src/​components/​file-input/​spec.md Documents null defaults and reset regression scenarios.
src/​components/​file-input/​file-input.ts Exposes a null default and removes redundant default handling.
src/​components/​file-input/​file-input.spec.ts Tests reset behavior after file-list and string default writes.
src/​components/​date-time-input/​date-time-input.ts Adds typed date defaults with string input support.
src/​components/​date-range-picker/​date-range-picker.ts Adds typed range defaults with string input support.
src/​components/​date-picker/​date-picker.ts Adds typed date defaults with string input support.
src/​components/​combo/​combo.ts Types defaults as ComboValue<T>[].
src/​components/​color-picker/​color-picker.ts Types defaultValue as string.
public-api.json Records concrete default types and the corrected date-time value type.
CHANGELOG.md Records typing changes, manifest correction, and file-reset fix.
cem.config.mjs Resolves explicitly typed overrides through the TypeScript checker.
api-reference/​igc-textarea.md Documents string defaults.
api-reference/​igc-slider.md Documents numeric defaults.
api-reference/​igc-select.md Documents string-or-undefined defaults.
api-reference/​igc-rating.md Documents numeric defaults.
api-reference/​igc-mask-input.md Documents string defaults.
api-reference/​igc-input.md Documents string defaults.
api-reference/​igc-file-input.md Documents always-null defaults and reset behavior.
api-reference/​igc-date-time-input.md Corrects the value type and documents date defaults.
api-reference/​igc-date-range-picker.md Documents nullable date-range defaults.
api-reference/​igc-date-picker.md Documents nullable date defaults.
api-reference/​igc-combo.md Documents typed selection-array defaults.
api-reference/​igc-color-picker.md Documents string defaults.

Review effort: Balanced

@rkaraivanov
rkaraivanov merged commit 1c4542c into master Nov 25, 2026
11 checks passed
@rkaraivanov
rkaraivanov deleted the rkaraivanov/typed-default-value branch November 25, 2026 15:40
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