1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

[search] 'turn on/off semantic search': click outside to close the 'setting' popover (#5937)

This commit is contained in:
llj
2024-02-04 15:29:58 +08:00
committed by GitHub
parent db4208648a
commit 608de45b6f
2 changed files with 23 additions and 4 deletions

View File

@@ -5,9 +5,9 @@ import classnames from 'classnames';
import '../../../css/switch.css';
function Switch(props) {
const { onChange, checked, placeholder, disabled, className, size, textPosition } = props;
const { onChange, checked, placeholder, disabled, className, size, textPosition, setRef } = props;
return(
<div className={classnames('seahub-switch position-relative', className, size)}>
<div className={classnames('seahub-switch position-relative', className, size)} ref={setRef}>
<label className="custom-switch">
<input
className="custom-switch-input"
@@ -37,6 +37,7 @@ Switch.propTypes = {
size: PropTypes.oneOf(['large', 'small', undefined]),
textPosition: PropTypes.oneOf(['left', 'right', undefined]),
onChange: PropTypes.func,
setRef: PropTypes.func
};
Switch.defaultProps = {