Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve _value type for single select: Allow arbitrary values #7428

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

sdvg
Copy link
Member

@sdvg sdvg commented Feb 28, 2025

Refs: #7387

The A11y and PO reviews will only take place after all other DoD steps have been completed by the Developer:

  • Meaningful pull request title for the release notes
  • Pull request is linked to an issue and all changes relate to the issue
  • Tests to protect this code implemented (if applicable)
  • Manual test performed successfully (if applicable)
  • Documentation or migration has been updated (if applicable)

@sdvg sdvg linked an issue Feb 28, 2025 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Feb 28, 2025

@sdvg sdvg marked this pull request as ready for review February 28, 2025 11:36
@sdvg sdvg added the v3 Here are issues that need to be resolved for version 3. label Feb 28, 2025
@laske185 laske185 requested a review from Copilot March 3, 2025 08:28

Choose a reason for hiding this comment

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

PR Overview

This pull request updates the _value property for the single select component to allow arbitrary values instead of only strings. Key changes include updating the types and validation logic in the controller, schema, and shadow files to use StencilUnknown.

Reviewed Changes

File Description
packages/components/src/components/single-select/controller.ts Updated the validateValue method to use StencilUnknown and watchValidator instead of watchString
packages/components/src/schema/components/single-select.ts Changed the _value prop type from string to StencilUnknown
packages/components/src/components/single-select/shadow.tsx Modified _value type and related methods (getValue, updateInputValue) to support StencilUnknown

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/components/src/components/single-select/controller.ts:47

  • Using Boolean as the validator may not be sufficient for validating arbitrary values. Consider reviewing if a more appropriate validation function or mechanism is needed to handle the wider range of types allowed by StencilUnknown.
watchValidator(this.component, '_value', Boolean, new Set([`StencilUnknown`]), value);
Co-authored-by: Peter Laske <[email protected]>
Signed-off-by: Martin <[email protected]>
deleonio
deleonio previously approved these changes Mar 4, 2025
@laske185 laske185 merged commit 5948a63 into develop Mar 4, 2025
8 of 13 checks passed
@laske185 laske185 deleted the 7387-single-select-value-type-v3 branch March 4, 2025 14:40
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
v3 Here are issues that need to be resolved for version 3.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type-Fehler beim _value-Property des Single-Select.
3 participants