Skip to content

Conversation

@pbuba
Copy link

@pbuba pbuba commented Apr 30, 2025

  • add hook to sorting selected options on open
  • add sorting hook for multi-select component
  • add enable flag

@vercel
Copy link

vercel bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
canary ❌ Failed (Inspect) May 2, 2025 7:39am

if (enable && isOpen) {
setSnapshotIds(new Set(selectedItems.map(item => item.id)))
}
}, [isOpen, enable])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid using useEffect here — especially since selectedItems might not be updated at the right time.
You already have the onOpenChange event on DropdownMenu.Root.

searchValue={searchTag}
handleChangeSearchValue={setSearchTag}
error={errors.tags?.message?.toString()}
enableSortOnOpen
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this should be the default behavior, so we can remove this prop and always apply sorting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants