-
Notifications
You must be signed in to change notification settings - Fork 2
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
Select
and TypeaheadSelect
improvements
#227
base: next-release
Are you sure you want to change the base?
Conversation
- Add title as an interface prop and set type as ReactNode - Create an enum for Language options and use it in Select and TypeaheadSelect components
- Use contentRenderer as Select.Item content - Use contentRenderer for tag content as we removed the title prop - Instead of handling the keyword change inside TypeaheadSelect by filtering titles, handle it outside of the component
…d to set initial and changeable value - Set canSelectMultiple to false if options.length is not bigger than 1 - Add testid to use in typeahead-select.test - Add onClick optional prop to TypeheadSelectTrigger to set the correct classname when the menu is open - setMenuVisibility to false if shouldCloseOnSelect is true, so that the classnames are correct - Remove input styles when TypeaheadSelectInput is used inside of the trigger - Add testid to TypeheadSelectTrigger to test it easily - Fix most of the test cases for typeahead-select - Fix classnames - I used screen.findByText function to find the option but I can update it Note:- In my opinion, having two classnames for typeahead-select and select is a bit unnecessary. We can just add typeahead-select as main classname and override select classnames if necessary. - I couldn't fix a11y test case for the typeahead-select.
|
I guess only the last two commits belongs to this PR |
…he context state from the props with generateSelectState function
Let's update the PR title |
…ce we are handling the keyword state on our projects - controlledKeyword is the typeaheadProps.value with initial value - Update typeahead-select.test - Update stories
Select
/TypeaheadSelect
improvements
Select
/TypeaheadSelect
improvementsSelect
and TypeaheadSelect
improvements
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.
Let's try to follow this priority:
https://testing-library.com/docs/queries/about/#priority
}: TypeheadSelectTriggerProps) { | ||
return ( | ||
<Select.Trigger customClassName={"typeahead-select-trigger"}> | ||
<Select.Trigger customClassName={"typeahead-select-trigger"} onClick={onClick}> |
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.
Let's see why this was added and if it's necessary
props.options
as initialoptions
value inselectOwnState
, async options are not added in the options array. So, the asyncSelectItem
has an index value of -1 which is equal to thefocusedOptionIndex
. That was why async items were highlighted unintentionally. -> resolves issue Select: Weird bug withoptions
state #208Id
type forOption
interface -> resolves issue Select: Type improvements #206