bennettfeely/bennett

ztext: Selections sometimes contain duplicate text for each layer

Fire- opened this issue · 3 comments

Fire- commented

This is a really cool project!

It looks like sometimes attempts to select and copy a string duplicate the string in the selection for each layer present. For example:

image

Similarly, copying the "80px" in a different example produced the following clipboard contents:

80px
80px
80px
80px
80px
80px
80px
80px
80px
80px

I believe this is mostly just an artifact of how layering is accomplished, but that the results were inconsistent is what I find most curious - further attempts to replicate this seem to result in only one copy in the clipboard ( though an extra line feed seems to be tagging along as well )

Could you provide sample code or a link to a codepen?

The one on the example page does this on mobile (if I hold the text to select, and if I change the selection, it disappears), and CTRL + A does the same

I'm aware of this issue. Not sure what else I can do about it. user-select:none and especially pointer-events: none are applied to the duplicate layers yet Chrome still selects that text. Still open to suggestions though