add --disable-model-switch

This commit is contained in:
Qing
2022-11-13 13:14:37 +08:00
parent 8cdac238b4
commit 0666a32947
6 changed files with 41 additions and 2 deletions

View File

@@ -24,6 +24,11 @@
// &:focus-visible {
// border-color: var(--yellow-accent);
// }
&:disabled {
color: var(--border-color);
border-color: var(--border-color);
}
}
.select-content {

View File

@@ -15,6 +15,7 @@ interface Props {
chevronDirection?: SelectorChevronDirection
autoFocusAfterClose?: boolean
onChange: (value: string) => void
disabled?: boolean
}
const Selector = (props: Props) => {
@@ -25,6 +26,7 @@ const Selector = (props: Props) => {
options,
autoFocusAfterClose,
onChange,
disabled,
} = props
const contentRef = useRef<HTMLButtonElement>(null)
@@ -52,6 +54,7 @@ const Selector = (props: Props) => {
style={{ width }}
ref={contentRef}
onKeyDown={e => e.preventDefault()}
disabled={disabled}
>
<Select.Value />
<Select.Icon>
@@ -78,6 +81,7 @@ const Selector = (props: Props) => {
const selectorDefaultProps = {
chevronDirection: 'down',
autoFocusAfterClose: true,
disabled: false,
}
Selector.defaultProps = selectorDefaultProps