Skip to content

Commit 1220fec

Browse files
committed
Fix position of options
1 parent add84f0 commit 1220fec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CodeSnippetDisplay.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ export class CodeSnippetDisplay extends React.Component<
631631
): void {
632632
const target = event.target as HTMLElement;
633633
let top: number;
634+
console.log(target.tagName);
634635
if (target.tagName === 'path') {
635636
top = target.getBoundingClientRect().top + 10;
636637
} else {
@@ -640,8 +641,10 @@ export class CodeSnippetDisplay extends React.Component<
640641
top -= 120;
641642
}
642643
const leftAsString =
643-
target.getBoundingClientRect().left.toString(10) + 'px';
644+
(target.parentElement.style.left + event.pageX).toString() + 'px';
645+
644646
const topAsString = top.toString(10) + 'px';
647+
645648
document.documentElement.style.setProperty(
646649
'--more-options-top',
647650
topAsString

0 commit comments

Comments
 (0)