Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(16575): modify useIsTruncated hook in ListBoxMenuItem
Browse files Browse the repository at this point in the history
ahmedsemih committed May 26, 2024

Verified

This commit was signed with the committer’s verified signature.
lsorber Laurent Sorber
1 parent f7065bc commit 038bc49
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
@@ -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]);

0 comments on commit 038bc49

Please sign in to comment.