-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: OPTIC-1733: Standardize Dropdown Components Using LSE selector #7257
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
base: develop
Are you sure you want to change the base?
Conversation
…e try to spread its values
…s/label-studio into fb-optic-1748/ui-improvements
…1748/ui-improvements" This reverts commit 233340c.
web/libs/datamanager/src/components/Filters/FilterLine/FilterLine.scss
Outdated
Show resolved
Hide resolved
/fm sync |
/git merge
|
setValue((prev = []) => { | ||
if (isSelected) { | ||
return (selectedOptions = [...prev.filter((v) => v !== val)]); | ||
} | ||
return (selectedOptions = [...prev, val]); | ||
}); |
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.
this could cause an issue with the callback handler getting called after passing selectedOptions up to props.onChange. use a valueRef instead of the callback
)} | ||
</button> | ||
</PopoverTrigger> | ||
<PopoverContent className="z-99999 min-w-full" align="start" data-testid="select-popup"> |
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.
<PopoverContent className="z-99999 min-w-full" align="start" data-testid="select-popup"> | |
<PopoverContent align="start" data-testid="select-popup"> |
onSelect={() => { | ||
children.forEach((child: SelectOption<T>) => { | ||
const childVal = child?.value ?? child; | ||
isOptionSelected ? _onChange(childVal, true) : _onChange(childVal, 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.
isOptionSelected ? _onChange(childVal, true) : _onChange(childVal, false); | |
_onChange(childVal, isOptionSelected); |
/fm sync |
New unified Select component

This pull request primarily focuses on replacing existing
Select
components with theSelect
component from the@humansignal/ui
library across multiple files. Additionally, it includes some refactoring and enhancements to improve code readability and functionality. Below are the most important changes:UI Component Updates:
Select
components withSelect
from@humansignal/ui
in various files, includingSelect.jsx
,Pagination.tsx
,Config.jsx
,CreateProject.jsx
,GeneralSettings.jsx
,Forms.jsx
,StorageForm.jsx
,SampleDatasetSelect.tsx
,ModelVersionSelector.jsx
, andSelect.jsx
in thedatamanager
directory. [1] [2] [3] [4] [5] [6] [7] [8] Fbb5e0ebL1, [9]Functional Enhancements:
Select
components to use the newonChange
signature provided by@humansignal/ui
, replacing the previous event-based handlers. [1] [2] [3] [4] [5] [6]Code Refactoring:
useMemo
hooks to optimize the computation of options forSelect
components, ensuring better performance and readability. [1] [2] [3]CSS and Layout Adjustments:
Select
component layout, including changes inuikit.css
to usedisplay: flex
instead ofdisplay: block
.Miscellaneous:
These changes collectively enhance the consistency and maintainability of the codebase by standardizing the use of the
Select
component from@humansignal/ui
and optimizing related code.