diff --git a/frontend/src/components/dialog/share-to-group.js b/frontend/src/components/dialog/share-to-group.js index e02af5180b..8e11dc5d7b 100644 --- a/frontend/src/components/dialog/share-to-group.js +++ b/frontend/src/components/dialog/share-to-group.js @@ -27,9 +27,7 @@ class ShareToGroup extends React.Component { } handleSelectChange = (option) => { - this.setState({ - selectedOption: option, - }); + this.setState({selectedOption: option}); } componentDidMount() { @@ -115,7 +113,8 @@ class ShareToGroup extends React.Component { }); this.setState({ - sharedItems: this.state.sharedItems.concat(items) + sharedItems: this.state.sharedItems.concat(items), + selectedOption: null, }); }); } else { @@ -131,7 +130,8 @@ class ShareToGroup extends React.Component { } this.setState({ - sharedItems: this.state.sharedItems.concat(res.data.success) + sharedItems: this.state.sharedItems.concat(res.data.success), + selectedOption: null, }); }); } @@ -173,6 +173,7 @@ class ShareToGroup extends React.Component { options={this.options} components={makeAnimated()} inputId={'react-select-2-input'} + value={this.state.selectedOption} /> @@ -213,7 +214,7 @@ function GroupList(props) { {item.group_info.name} {Utils.sharePerms[item.permission]} - {props.deleteShareItem(e, item.group_info.id);}} className="sf2-icon-delete" title="Delete"> + {props.deleteShareItem(e, item.group_info.id);}} className="sf2-icon-x3 sf2-x op-icon" title={gettext('Delete')}> ))} diff --git a/frontend/src/components/dialog/share-to-user.js b/frontend/src/components/dialog/share-to-user.js index ecd6b10e47..f587a87c96 100644 --- a/frontend/src/components/dialog/share-to-user.js +++ b/frontend/src/components/dialog/share-to-user.js @@ -113,9 +113,10 @@ class ShareToUser extends React.Component { return sharedItem; }); this.setState({ - sharedItems: this.state.sharedItems.concat(items) + sharedItems: this.state.sharedItems.concat(items), + selectedOption: null, }); - }) + }); } else { seafileAPI.shareFolder(repoID, path, 'user', this.state.permission, users).then(res => { if (res.data.failed.length > 0) { @@ -126,7 +127,8 @@ class ShareToUser extends React.Component { this.setState({errorMsg: errorMsg}); } this.setState({ - sharedItems: this.state.sharedItems.concat(res.data.success) + sharedItems: this.state.sharedItems.concat(res.data.success), + selectedOption: null, }); }); } @@ -164,12 +166,16 @@ class ShareToUser extends React.Component { @@ -211,7 +217,7 @@ function UserList(props) { {item.user_info.nickname} {Utils.sharePerms[item.permission]} - {props.deleteShareItem(e, item.user_info.name);}} className="sf2-icon-delete" title="Delete"> + {props.deleteShareItem(e, item.user_info.name);}} className="sf2-icon-x3 sf2-x op-icon" title={gettext('Delete')}> ))}