Skip to content

Commit

Permalink
fix: ListBox animation
Browse files Browse the repository at this point in the history
  • Loading branch information
MildTomato committed Feb 12, 2022
1 parent a824594 commit d38f9b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Listbox/Listbox2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ function Listbox({
}, [value])

useEffect(() => {
console.log(triggerRef?.current?.offsetWidth)
if (document) {
document.documentElement.style.setProperty('--width-listbox', `533px`)
}
document.documentElement.style.setProperty(
'--width-listbox',
`${triggerRef.current?.offsetWidth}px`
)
}, [])

useEffect(() => {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/theme/defaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,10 @@ export default {
border-gray-100 dark:border-gray-600 max-h-60
rounded-md py-1 text-base
sm:text-sm z-10 overflow-hidden overflow-y-scroll
origin-dropdown
data-open:animate-dropdown-content-show
data-closed:animate-dropdown-content-hide
`,
with_icon: 'pl-10',
addOnBefore: `
Expand Down

0 comments on commit d38f9b2

Please sign in to comment.