Is there a way to a way to use position: sticky
inside SVG? Similar to how this example work.
To complicate the matter slightly, I am looking to use position: sticky
inside an SVG element inside another div
with overflow:auto
. I have a created an example of what I am trying to achieve inside this codesandbox.
Edit 1: Not sure whether this makes a difference, but for context in my own application I am using react & react-redux to include/exclude shapes to form a graph. The requirement is to keep some elements at the top of the view port when scrolling the same way Excel would if you would to freeze a header/row.
Edit 2: Updated the sandbox to include the answer's code