From 1bf3350c8c1c89d7deb1f34c27023a7ab868eb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= Date: Thu, 26 Dec 2024 15:17:16 +0800 Subject: [PATCH] feat: search input --- .../components/common/group-select/select-option-group.js | 4 ++-- frontend/src/components/common/search-input.js | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/common/group-select/select-option-group.js b/frontend/src/components/common/group-select/select-option-group.js index c7b024b22f..4bf9ab8fba 100644 --- a/frontend/src/components/common/group-select/select-option-group.js +++ b/frontend/src/components/common/group-select/select-option-group.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; -import { SearchInput } from '@seafile/sf-metadata-ui-component'; +import SearchInput from '../search-input'; import Option from './option'; import KeyCodes from '../../../constants/keyCodes'; import ClickOutside from './click-outside'; @@ -45,7 +45,6 @@ class SelectOptionGroup extends Component { this.optionGroupRef.style.top = (position.y - height) + 'px'; } this.optionGroupRef.style.opacity = 1; - this.searchInputRef.current && this.searchInputRef.current.inputRef.focus(); } else { if (height + top > window.innerHeight) { @@ -181,6 +180,7 @@ class SelectOptionGroup extends Component {
{ - const getType = {}; - return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; - }; - renderClear = () => { const { isClearable, clearClassName, components = {} } = this.props; const { searchValue } = this.state; @@ -99,7 +95,7 @@ class SearchInput extends Component { const { ClearIndicator } = components; if (React.isValidElement(ClearIndicator)) { return React.cloneElement(ClearIndicator, { clearValue: this.clearSearch }); - } else if (this.isFunction(ClearIndicator)) { + } else if (Utils.isFunction(ClearIndicator)) { return ; } return (