-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add support for dragging SVGElement's #613
Comments
Dragging an type DraggableProvided = {|
+ innerRef: HTMLElement => void,
draggableProps: DraggableProps,
// will be null if the draggable is disabled
dragHandleProps: ?DragHandleProps,
|}; The element provided needs to be a
Given our focus on accessibility, I think we need to keep the requirement of a Draggable being a Thoughts? |
We did a bit of looking at this one is really confusing. We could not find much information about Hmmm |
So if you had a user using ie11 with keyboard dragging they would previously have gotten an exception. I think the best option to keep the HTMLElement requirement and recommend wrapping SVG's in a HTMLElement for dragging. Still thinking and exploring though! |
The error message reads |
We can definitely add some clarity to both of those. We are still exploring for now |
It turns out using
We could look into borrowing something like this: In the short term we can add some more helpful messaging and docs while we continue to investigate this one |
Bug or feature request?
Bug
Expected behavior
Ref check on a
svg
element does not fail.Actual behavior
Ref check on a
svg
element fails.Steps to reproduce
Add
<svg ref={provided.innerRef}>
as a child of<Draggable>
. ThethrowIfRefIsInvalid
check will fail because svg elements don't inherit fromHTMLElement
(they inherit fromSVGElement
).What version of
React
are you using?16.4.1
What version of
react-beautiful-dnd
are you running?8.0.0
What browser are you using?
Chrome 66.0.3359.181 x64
Demo
https://codesandbox.io/s/31w7vj1vxp
It can be fixed by wrapping the
svg
in adiv
(or other element that inherits fromHTMLElement
).Like this: https://codesandbox.io/s/2xzvrr2znr
The text was updated successfully, but these errors were encountered: