Skip to content

Commit

Permalink
fix(16575): modify useIsTruncated hook in ListBoxMenuItem (#16576)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedsemih authored Jun 3, 2024
1 parent 5f79664 commit 364ffc8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/components/ListBox/ListBoxMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ function useIsTruncated(ref) {

useEffect(() => {
const element = ref.current;
const { offsetWidth, scrollWidth } =
element.lastElementChild?.lastElementChild || element;
const { offsetWidth, scrollWidth } = element;
setIsTruncated(offsetWidth < scrollWidth);
}, [ref, setIsTruncated]);

Expand Down

0 comments on commit 364ffc8

Please sign in to comment.