Просмотр исходного кода

Fix execution row collapse when copying to clipboard for the first time CORWB-59

Removed unnecesary click event stopper from copy button.
Sergiu Miclea 8 лет назад
Родитель
Сommit
69848d564c
2 измененных файлов с 3 добавлено и 7 удалено
  1. 2 1
      src/components/Table/Table.js
  2. 1 6
      src/components/Tasks/Tasks.js

+ 2 - 1
src/components/Table/Table.js

@@ -50,7 +50,8 @@ class Table extends Component {
     for (let i in newProps.listItems) {
       // Use the previous open state if the table's parent ID is the same
       // i.e. don't close the collapser if new props arrive
-      let prevOpenState = newProps.parentId === this.state.parentId && this.state.openState[i]
+      let isSameParent = this.state.parentId === null || newProps.parentId === this.state.parentId
+      let prevOpenState = isSameParent && this.state.openState[i]
       openState.push(newProps.listItems[i].openState || prevOpenState)
     }
     this.setState({ openState: openState, parentId: newProps.parentId })

+ 1 - 6
src/components/Tasks/Tasks.js

@@ -161,15 +161,10 @@ class Tasks extends Component {
   }
 
   copyIdClick(e, item) {
-    e.preventDefault()
-    e.nativeEvent.preventDefault();
-    e.stopPropagation();
-    e.nativeEvent.stopImmediatePropagation();
-
     let succesful = Helper.copyTextToClipboard(item.id)
 
     if (succesful) {
-      NotificationActions.notify('The ID was copied to clipboard.')
+      NotificationActions.notify('The ID has been copied to clipboard.')
     } else {
       NotificationActions.notify('The ID couldn\'t be copied', 'error')
     }