Guidance requested re: adding dynamic, temporary class #707
Unanswered
apg-dev
asked this question in
Questions & Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a functional table of contents built from using dynamically created unique id's on each header tag, and then parsing the dom for all h elements and inserting a custom span for each header item - containing the header text. A listener on those span tags handles the ToC click and scrolls to the correct header location within the editor. That all works fine.
Where I'm running into trouble is this: I'd like to do the equivalent of the following in order to briefly flash a yellow background around the just-scrolled-to header tag.
I've tried playing around with decorators - without much luck - and was thinking there must be a simple way to dynamically add and remove a temporary class to a block element like a header. My custom header node includes every attribute I can think of, and it's still not working. Given my extremely limited TipTap/ProseMirror skills, I cannot figure it out.
Really appreciate any guidance that can be offered. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions