Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select text and copy #102

Open
pedrojfds opened this issue Apr 4, 2024 · 3 comments
Open

Select text and copy #102

pedrojfds opened this issue Apr 4, 2024 · 3 comments

Comments

@pedrojfds
Copy link

After adding panZoom to the SVG, selecting and copying text within the SVG becomes disabled. Although the cursor appears as a text cursor upon hovering, clicking is captured, preventing text selection. Is it possible to disable pointer capture when hovering over text?

@Fuzzyma
Copy link
Member

Fuzzyma commented Apr 5, 2024

That would lead to weird behavior. You would zoom in and all of a sudden the zoom doesn't work anymore because you happen to hover text on accident.

If you want that anyway you can Try to prevent propagation on the text elements

@pedrojfds
Copy link
Author

The idea would be to not allow the pan to start on top of those text elements (since the mouse would be used for the selection), but once the pan is initiated, it wouldn't matter where the pointer is.
Regarding the zoom, it is performed with the wheel. It shouldn't interfere with the text selection since there is no mouse capture with the wheel, is there?

@Fuzzyma
Copy link
Member

Fuzzyma commented Apr 5, 2024

I think for that to work you could actually just go ahead and stop propagation for all text elements.

It could be worth to add this as an option. In that case we would need to filter out mousedown events that origin from a text, tspan or textPath. Feel free to implement that and send a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants