yusuketk %!s(int64=7) %!d(string=hai) anos
pai
achega
0dc83fd3cd

+ 3 - 2
src/client/js/components/Page/TagLabel.jsx

@@ -31,7 +31,7 @@ class TagLabel extends React.Component {
     const pageId = this.props.pageId;
     if (pageId) {
       const res = await this.props.crowi.apiGet('/pages.getPageTag', { pageId });
-      this.setState({ currentPageTags: res.tags });
+      this.setState({ currentPageTags: res.tags, newPageTags: res.tags });
       this.props.sendTagData(res.tags);
     }
   }
@@ -41,7 +41,8 @@ class TagLabel extends React.Component {
   }
 
   handleCloseModal() {
-    this.setState({ isOpenModal: false });
+    // reset state newPageTags when user close modal without push Done button
+    this.setState({ isOpenModal: false, newPageTags: this.state.currentPageTags });
   }
 
   handleShowModal() {

+ 1 - 1
src/client/js/components/PageTagForm.jsx

@@ -30,7 +30,7 @@ export default class PageTagForm extends React.Component {
   }
 
   handleChange(selected) {
-    // list is a list of object about value. an element have customOption, id and label properties
+    // send tags to TagLabel Component when user add tag to form everytime
     this.setState({ selected }, () => {
       this.props.addNewTag(this.state.selected);
     });