Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit e73b35b

Browse files
Anton BilovusTigge
authored andcommitted
fix(expandableList): use useHasOverflowWithResizeEvent hook for text
If expandable list is hidden by default than all the items get tooltips as the `useHasOverflow` will detect that the text for all the items is not completely shown so by using `useHasOverflowWithResizeEvent` the check will run on each resize which will resolve this issue.
1 parent 8b7d228 commit e73b35b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/ExpandableList/ListItemContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useCallback } from 'react'
22
import styled, { css } from 'styled-components'
3-
import { useHasOverflow } from 'react-hooks-shareable'
3+
import { useHasOverflowWithResizeEvent } from 'react-hooks-shareable'
44

55
import { shape, spacing } from '../designparams'
66
import { Icon, IconType } from '../Icon'
@@ -162,7 +162,7 @@ interface OverflowTooltipProps {
162162
* Used to show a tooltip if label is too long to be fully shown in container.
163163
*/
164164
const LabelOverflowTooltip: React.FC<OverflowTooltipProps> = ({ label }) => {
165-
const { hasOverflow, ref } = useHasOverflow()
165+
const { hasOverflow, ref } = useHasOverflowWithResizeEvent()
166166

167167
const text = <Label ref={ref}>{label}</Label>
168168

0 commit comments

Comments
 (0)