File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -123,18 +123,18 @@ const SortableMixin = (options = defaultOptions) => (Component) => class extends
123
123
this . initSortable ( this . refs [ refName ] ) ;
124
124
}
125
125
componentWillUnmount ( ) {
126
- if ( this . sortableInstance ) {
127
- this . sortableInstance . destroy ( ) ;
128
- this . sortableInstance = null ;
129
- }
126
+ this . destroySortable ( ) ;
130
127
}
131
128
initSortable ( sortableComponent ) {
129
+ this . destroySortable ( ) ;
130
+ const domNode = ReactDOM . findDOMNode ( sortableComponent . refs [ this . sortableOptions . ref ] || sortableComponent ) ;
131
+ this . sortableInstance = Sortable . create ( domNode , this . populatedOptions ) ;
132
+ }
133
+ destroySortable ( ) {
132
134
if ( this . sortableInstance ) {
133
135
this . sortableInstance . destroy ( ) ;
134
136
this . sortableInstance = null ;
135
137
}
136
- const domNode = ReactDOM . findDOMNode ( sortableComponent . refs [ this . sortableOptions . ref ] || sortableComponent ) ;
137
- this . sortableInstance = Sortable . create ( domNode , this . populatedOptions ) ;
138
138
}
139
139
140
140
render ( ) {
You can’t perform that action at this time.
0 commit comments