diff --git a/src/components/editable-list.jsx b/src/components/editable-list.jsx index e5817ac59..2440232f7 100644 --- a/src/components/editable-list.jsx +++ b/src/components/editable-list.jsx @@ -119,7 +119,7 @@ class EditableList extends Component { super(props); this.state = props.initialState || { dropInsertionIndex: -1, - editingIndex: null, + editingIndex: -1, creatingItem: false, }; } @@ -156,7 +156,7 @@ class EditableList extends Component { }; _clearEditingState = (callback)=> { - this._setStateAndFocus({editingIndex: null}, callback); + this._setStateAndFocus({editingIndex: -1}, callback); }; _clearCreatingState = (callback)=> { @@ -288,6 +288,12 @@ class EditableList extends Component { return; } + if (row.dataset.itemIdx / 1 === this.state.editingIndex / 1) { + // dragging the row currently being edited makes text selection impossible + event.preventDefault(); + return; + } + event.dataTransfer.setData('editablelist-index', row.dataset.itemIdx); event.dataTransfer.setData('editablelist-reactid', wrapperId); event.dataTransfer.effectAllowed = "move";