|
@@ -15,9 +15,13 @@
|
|
let contentContainerElement;
|
|
let contentContainerElement;
|
|
let buttonsContainerElement;
|
|
let buttonsContainerElement;
|
|
|
|
|
|
- const updateButtonPosition = () => {
|
|
|
|
|
|
+ const updateButtonPosition = (event) => {
|
|
setTimeout(async () => {
|
|
setTimeout(async () => {
|
|
await tick();
|
|
await tick();
|
|
|
|
+
|
|
|
|
+ // Check if the event target is within the content container
|
|
|
|
+ if (!contentContainerElement.contains(event.target)) return;
|
|
|
|
+
|
|
let selection = window.getSelection();
|
|
let selection = window.getSelection();
|
|
|
|
|
|
if (selection.toString().trim().length > 0) {
|
|
if (selection.toString().trim().length > 0) {
|