-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add static and dynamic custom dropdowns support #18
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: main
Are you sure you want to change the base?
Conversation
|
|
||
| export function DynamicCustomDropdownField(props: Props) { | ||
| const [searchQuery, setSearchQuery] = useState<string>(''); | ||
| const { ref, inView } = useInView(); |
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.
think we can use the useOnInView which takes a callback. This would replace the useEffect below
| allowClear | ||
| > | ||
| {allOptions.map((option) => ( | ||
| <ComboboxField.Item key={option.value} value={option.label}> |
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.
why are we using the label as the value prop? This prop is intended to be unique fields. Using the value would remove the allOptions.find above as well
| {hasNextPage && ( | ||
| <div | ||
| ref={ref} | ||
| className="flex items-center justify-center py-2 text-sm text-muted-foreground" | ||
| > | ||
| {isFetchingNextPage && ( | ||
| <div className="flex items-center gap-2"> | ||
| <LoaderCircle className="size-4 animate-spin" /> | ||
| Loading more... | ||
| </div> | ||
| )} | ||
| </div> | ||
| )} |
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.
niice!!! 👏
| customDropdownLoader={ | ||
| (customDropdownOptions as CustomDropdownOptions).loadOptions | ||
| } |
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.
think this prop could named as onLoad
Issues Closed
Brief Summary
add dynamic custom dropdown support with pagination