File tree 1 file changed +6
-3
lines changed
packages/bento-design-system/src/Tooltip
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,17 @@ export function Tooltip(props: Props) {
36
36
const config = useBentoConfig ( ) . tooltip ;
37
37
const arrowRef = useRef < HTMLElement | null > ( null ) ;
38
38
39
- const commonMiddleware = [ shift ( ) , offset ( 8 ) , arrow ( { element : arrowRef } ) ] ;
39
+ const commonMiddleware = [ shift ( ) , offset ( 8 ) ] ;
40
+ const arrowMiddleware = arrow ( { element : arrowRef } ) ;
40
41
const floatingProps : UseFloatingProps = props . placement
41
42
? {
42
43
placement : props . placement ,
43
- middleware : commonMiddleware . concat ( [ flip ( ) ] ) ,
44
+ middleware : commonMiddleware . concat ( [ flip ( ) , arrowMiddleware ] ) ,
44
45
}
45
46
: {
46
- middleware : commonMiddleware . concat ( [ autoPlacement ( ) ] ) ,
47
+ // NOTE(gabro): it's important that arrow comes after autoPlacement, otherwise the arrow will be positioned incorrectly
48
+ // See https://github.com/buildo/bento-design-system/issues/513
49
+ middleware : commonMiddleware . concat ( [ autoPlacement ( ) , arrowMiddleware ] ) ,
47
50
} ;
48
51
const {
49
52
x,
You can’t perform that action at this time.
0 commit comments