开发者

Dragging/selecting inside SVG in Firefox

开发者 https://www.devze.com 2023-03-11 02:04 出处:网络
I am making a web-application which uses an inline SVG as its basic UI element. Some of the UI actions include selecting the text in the SVG, and dr开发者_StackOverflow中文版agging across the SVG. Thi

I am making a web-application which uses an inline SVG as its basic UI element. Some of the UI actions include selecting the text in the SVG, and dr开发者_StackOverflow中文版agging across the SVG. This works in Webkit and Presto, but Gecko refuses to cooperate. When I try to drag across the SVG in Firefox, it initiates a drag action with the whole SVG image. Is there a way to prevent this default behaviour?


This behaviour is described in the following bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=525591

You can fix this by calling preventDefault() on the event.

This really needs to go in an FAQ somewhere.

0

精彩评论

暂无评论...
验证码 换一张
取 消