Open Bug 1698629 Opened 4 years ago Updated 10 months ago

Tapping SVG shape in use element invokes text selection UI

Categories

(Core :: DOM: Selection, defect, P3)

defect

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?

Flags: needinfo?(aethanyc)

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?

Flags: needinfo?(aethanyc) → needinfo?(mbrodesser)
See Also: → 1674763

(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 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?

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.

Flags: needinfo?(mbrodesser)
Severity: -- → S3
Priority: -- → P3
Webcompat Priority: ? → P3
Duplicate of this bug: 1878302
No longer duplicate of this bug: 1878302
See Also: → 1878302
You need to log in before you can comment on or make changes to this bug.