-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix(react-ui-kit): select types #4353
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,16 +31,17 @@ import type {Theme} from '../Layout'; | |
import InputLabel from './InputLabel'; | ||
|
||
export type Option = { | ||
value: string | number; | ||
value: string; | ||
label: string; | ||
description?: string; | ||
isDisabled?: boolean; | ||
}; | ||
|
||
interface SelectProps<IsMulti extends boolean> extends StateManagerProps<Option, IsMulti> { | ||
interface SelectProps<IsMulti extends boolean> extends Omit<StateManagerProps<Option, IsMulti>, 'onChange'> { | ||
id: string; | ||
dataUieName: string; | ||
options: Option[]; | ||
onChange: (value: Option) => void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't the value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You will have always single option on change click, if you can check it on MLS using this: https://wearezeta.atlassian.net/wiki/spaces/WEB/pages/567214882/Updating+dependencies+packages+in+development+Yalc ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that is incorrect from my testing.. for multi select it passes all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's what I assumed as well when talking to @przemvs |
||
wrapperCSS?: CSSObject; | ||
label?: string; | ||
helperText?: string; | ||
|
@@ -58,6 +59,7 @@ export const Select = <IsMulti extends boolean = false>({ | |
dataUieName, | ||
options, | ||
isMulti, | ||
onChange, | ||
wrapperCSS = {}, | ||
markInvalid = false, | ||
required = false, | ||
|
@@ -94,6 +96,7 @@ export const Select = <IsMulti extends boolean = false>({ | |
ValueContainer, | ||
IndicatorsContainer, | ||
}} | ||
onChange={onChange} | ||
hideSelectedOptions={false} | ||
isSearchable={false} | ||
isClearable={false} | ||
|
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.
the value will sometimes be a number
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.
Sure, but you can replace this value from string to number :) I talked about this with @aweiss-dev .
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.
in what case do we return a number? when we talk about inputs the input value will always be a string. unless the input event value gets manipulated before reaching the onChange
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.
cipher suites need to be a number for the BE to work
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.
But that gets done from the onChange handler right? The option and the onChange on the select are supposed to work with strings
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.
sorry i missed this mesage but yea thats fine also