Tapping SVG shape in use element invokes text selection UI
Categories
(Core :: DOM: Selection, defect, P3)
Tracking
()
Webcompat Priority | P3 |
People
(Reporter: twisniewski, Unassigned)
References
Details
In #1286882 we made tapping on basic SVG shapes not bring up the copy/paste selection UI. However, it appears that basic shapes in <use> elements still bring up the UI, causing an interop difference with Chrome, as revealed in this webcompat issue.
The site uses this markup for the icons:
<svg class="b-icon__svg" xmlns="http://www.w3.org/2000/svg">
<use xlink:href="#icon-viewer-arrow"></use>
</svg>
Where icon-viewer-arrow
is a path:
<svg id="icon-viewer-arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<path d="M8.753 29L6 26.211 18.21 15 6 3.79 8.753 1 24 15z"></path>
</svg>
If I apply -moz-user-select:none
to .b-icon__svg
the issue goes away, so I'm wondering if (since paths were given that style in #1286882) we could apply it to paths/etc in use elements as well?
Comment 1•4 years ago
|
||
TYLin, would it make sense to also apply https://searchfox.org/mozilla-central/rev/526a5089c61db85d4d43eb0e46edaf1f632e853a/layout/svg/svg.css#102-104 to use element? Thanks.
Comment 2•4 years ago
|
||
Making SVG shapes unselectable (Bug 1286882) has causes problems like bug 1674763 when copying <svg>
elements. Mirko has been tried to find a proper solution, so we probably don't want to add user-select:none
to <use>
element unless we really have no other solution.
Mirko, are you still working on bug 1674763, or are planning to cycle back to it?
Comment 3•4 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC-8) from comment #2)
Making SVG shapes unselectable (Bug 1286882) has causes problems like bug 1674763 when copying
<svg>
elements. Mirko has been tried to find a proper solution, so we probably don't want to adduser-select:none
to<use>
element unless we really have no other solution.Mirko, are you still working on bug 1674763, or are planning to cycle back to it?
I'm not working on it and don't plan to do so during the coming weeks. Presumably, I'd need to learn quite a lot about the related code, so it looks like a time-intensive fix for me.
Updated•4 years ago
|
Updated•3 years ago
|
Reporter | ||
Updated•2 years ago
|
Description
•