-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
… of just string Refs: #7387
Netlify Draft Deployment |
There was a problem hiding this comment.
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]>
Signed-off-by: Martin <[email protected]>
Refs: #7387
The A11y and PO reviews will only take place after all other DoD steps have been completed by the Developer: