Closed scottastrophic closed 6 years ago
@scottastrophic I don't get what the this.listEl
is for, you don't seem to be using it. Instead, why don't you do that?
-<RootRef rootRef={this.listEl}>
+<RootRef rootRef={provided.innerRef}>
It seems to work: https://codesandbox.io/s/ll8ppjklkl.
btw this FAQ should probably point to that helper now that it exists
Yes, it should! Do you want to submit a pull-request? :)
Ah! Beautiful, thanks. I knew something was off. And sure, will make a docs PR.
@scottastrophic Anytime you want :)
Context
I have custom component that creates a list of
<ExpansionPanel>
s which renders markup like this:I'm trying to use the pattern described in this issue to make these
<li>
s sortable.But I think the
draggableRef.hasAttribute is not a function
Type error in my minimal reproduction is a result ofSo the dragHandle (which is meant to be the entire sortable item) is being passed the instance rather than the
<li>
itself, and it bugs out. I tried using<RootRef>
(btw this FAQ should probably point to that helper now that it exists) but I think I may be Doing It Wrong™. Am I? Is what I'm trying to do possible, or do I need a wrapper? I tried avoiding the wrapper because that conflicted with the built-in pseudoselector margins.Your Environment