File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import TippyJS from '@tippyjs/react'
19
19
import { TooltipProps } from './types'
20
20
import ShortcutKeyComboTooltipContent from './ShortcutKeyComboTooltipContent'
21
21
import './styles.scss'
22
+ import { SUB_PIXEL_ERROR } from './constants'
22
23
23
24
const Tooltip = ( {
24
25
shortcutKeyCombo,
@@ -33,7 +34,9 @@ const Tooltip = ({
33
34
34
35
const handleMouseEnterEvent : React . MouseEventHandler = ( event ) => {
35
36
const { currentTarget : node } = event
36
- const isTextOverflowing = node . scrollWidth > node . clientWidth || node . scrollHeight > node . clientHeight
37
+ const isTextOverflowing =
38
+ node . scrollWidth > node . clientWidth + SUB_PIXEL_ERROR ||
39
+ node . scrollHeight > node . clientHeight + SUB_PIXEL_ERROR
37
40
if ( isTextOverflowing && ! isTextTruncated ) {
38
41
setIsTextTruncated ( true )
39
42
} else if ( ! isTextOverflowing && isTextTruncated ) {
Original file line number Diff line number Diff line change 17
17
export const TOOLTIP_CONTENTS = {
18
18
INVALID_INPUT : 'Valid input is required for all mandatory fields.' ,
19
19
}
20
+
21
+ export const SUB_PIXEL_ERROR = 1
You can’t perform that action at this time.
0 commit comments