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
123123 this . initSortable ( this . refs [ refName ] ) ;
124124 }
125125 componentWillUnmount ( ) {
126- if ( this . sortableInstance ) {
127- this . sortableInstance . destroy ( ) ;
128- this . sortableInstance = null ;
129- }
126+ this . destroySortable ( ) ;
130127 }
131128 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 ( ) {
132134 if ( this . sortableInstance ) {
133135 this . sortableInstance . destroy ( ) ;
134136 this . sortableInstance = null ;
135137 }
136- const domNode = ReactDOM . findDOMNode ( sortableComponent . refs [ this . sortableOptions . ref ] || sortableComponent ) ;
137- this . sortableInstance = Sortable . create ( domNode , this . populatedOptions ) ;
138138 }
139139
140140 render ( ) {
You can’t perform that action at this time.
0 commit comments