You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have the following code to handle annotations on my website:
let annotations = document.querySelectorAll('[data-type="annotation"]');
for (let i = 0; i < annotations.length; i++) {
let annotation = annotations[i];
let content = annotation.querySelector('[data-type="annotation-content"');
// content?.classList.remove('hidden');
let html = (content?.cloneNode(true) as HTMLElement).innerHTML;
content?.remove();
tippy([annotation], {
content: html,
trigger: 'click',
allowHTML: true,
});
}
Unfortunately it doesn't work when I click on the element. It only works when I comment out content?.remove();. What is the reason?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have the following code to handle
annotations
on my website:Unfortunately it doesn't work when I click on the element. It only works when I comment out
content?.remove();
. What is the reason?Beta Was this translation helpful? Give feedback.
All reactions