Commit 8ebd61f 1 parent 07445d0 commit 8ebd61f Copy full SHA for 8ebd61f
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export function setDefinitionPosition(
34
34
right : termRight ,
35
35
left : termLeft ,
36
36
width : termWidth ,
37
+ height : termHeight ,
37
38
} = termElement . getBoundingClientRect ( ) ;
38
39
39
40
const termParent = termParentElement ( termElement ) ;
@@ -64,7 +65,7 @@ export function setDefinitionPosition(
64
65
definitionElement . setAttribute ( 'relativeX' , String ( termX ) ) ;
65
66
definitionElement . setAttribute ( 'relativeY' , String ( termY ) ) ;
66
67
67
- const offsetTop = 25 ;
68
+ const offsetTop = termHeight + 5 ;
68
69
const definitionParent = definitionElement . parentElement ;
69
70
70
71
if ( ! definitionParent ) {
@@ -79,7 +80,10 @@ export function setDefinitionPosition(
79
80
const fitDefinitionDocument =
80
81
document . body . clientWidth > definitionRightCoordinate ? 0 : definitionWidth - termWidth ;
81
82
82
- definitionElement . style . top = Number ( getCoords ( termElement ) . top + offsetTop ) + 'px' ;
83
+ const customHeaderTop = getCoords ( definitionParent ) . top - definitionParent . offsetTop ;
84
+
85
+ definitionElement . style . top =
86
+ Number ( getCoords ( termElement ) . top + offsetTop - customHeaderTop ) + 'px' ;
83
87
definitionElement . style . left =
84
88
Number (
85
89
getCoords ( termElement ) . left -
You can’t perform that action at this time.
0 commit comments