Skip to content

refactor(select): use model for value input#2311

Open
spike-rabbit wants to merge 1 commit into
mainfrom
refactor/select/use-value-model
Open

refactor(select): use model for value input#2311
spike-rabbit wants to merge 1 commit into
mainfrom
refactor/select/use-value-model

Conversation

@spike-rabbit

@spike-rabbit spike-rabbit commented Jul 10, 2026

Copy link
Copy Markdown
Member

This is a preparation for the signal form migration.
As we need to have a value model for that.
As a side effect we also drop the remaining @Input
within the si-select.
This change is causing a breaking change,
as for single value we cannot provide a default so valueChange
will always include undefined.
For multi select we provide a default, so undefined
is no longer a valid value.

BREAKING CHANGE:
value/valueChange of the si-select are now a signal model.

This slightly changes the behavior:

  • In case of single select, valueChange can now emit undefined.
  • In case of multi select, undefined can no longer be assigned to value.
  • When setting a value via ngModel / formControl, valueChange will now emit

Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors the selection strategy in the element-ng library by replacing Input and output with Angular model signals for better state management. It updates several components, including SiRelativeDateComponent, SiPhoneNumberInputComponent, and SiSelectMultiValueDirective, to support these changes. Review feedback identified a potential runtime crash in SiRelativeDateComponent due to improper handling of undefined values, a violation of the repository style guide regarding the use of effect() for state propagation in SiSelectSelectionStrategy, and a discrepancy in JSDoc documentation for the value model in SiSelectSingleValueDirective.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread projects/element-ng/date-range-filter/si-relative-date.component.ts
@spike-rabbit spike-rabbit force-pushed the refactor/select/use-value-model branch 3 times, most recently from 21864d0 to 8e4941f Compare July 10, 2026 09:12
@spike-rabbit spike-rabbit marked this pull request as ready for review July 10, 2026 09:23
@spike-rabbit spike-rabbit requested review from a team as code owners July 10, 2026 09:23
This is a preparation for the signal form migration.
As we need to have a `value` `model` for that.
As a side effect we also drop the remaining `@Input`
within the `si-select`.
This change is causing a breaking change,
as for single value we cannot provide a default so `valueChange`
will always include undefined.
For multi select we provide a default, so `undefined`
is no longer a valid value.

BREAKING CHANGE:
`value/valueChange` of the `si-select` are now a signal `model`.

This slightly changes the behavior:
- In case of single select, `valueChange` can now emit `undefined`.
- In case of multi select, `undefined` can no longer be assigned to `value`.
@spike-rabbit spike-rabbit force-pushed the refactor/select/use-value-model branch from 8e4941f to a5e5a20 Compare July 10, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant