1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 19:29:56 +00:00

optimize code (#5605)

This commit is contained in:
杨顺强
2023-08-24 12:10:05 +08:00
committed by GitHub
parent fb4525bef3
commit 68e53b3d45
10 changed files with 14 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ const propTypes = {
isTextMode: PropTypes.bool.isRequired, // there will be two mode. first: text and select. second: just select
isEditing: PropTypes.bool,
isEditIconShow: PropTypes.bool.isRequired,
autoFocus: PropTypes.bool,
options: PropTypes.array.isRequired,
currentOption: PropTypes.string.isRequired,
translateOption: PropTypes.func.isRequired,
@@ -16,7 +17,6 @@ const propTypes = {
toggleItemFreezed: PropTypes.func,
enableAddCustomPermission: PropTypes.bool,
onAddCustomPermissionToggle: PropTypes.func,
};
class SelectEditor extends React.Component {
@@ -24,6 +24,7 @@ class SelectEditor extends React.Component {
static defaultProps = {
enableAddCustomPermission: false,
isEditing: false,
autoFocus: false,
}
constructor(props) {
@@ -145,6 +146,7 @@ class SelectEditor extends React.Component {
menuPortalTarget={document.querySelector('#wrapper')}
styles={MenuSelectStyle}
onMenuClose={this.onMenuClose}
autoFocus={this.props.autoFocus}
menuShouldScrollIntoView
/>
}