File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
packages/shared/widget-plugin-dropdown-filter/src/controls/select Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,9 @@ import { useSelect, UseSelectProps } from "downshift";
3
3
import { observer } from "mobx-react-lite" ;
4
4
import React , { createElement , useRef } from "react" ;
5
5
import { OptionWithState } from "../../typings/OptionWithState" ;
6
- import { ClearButton } from "../base/ClearButton" ;
7
6
import { OptionsWrapper } from "../base/OptionsWrapper" ;
8
7
import { useFloatingMenu } from "../hooks/useFloatingMenu" ;
9
- import { Arrow , classes } from "../picker-primitives" ;
8
+ import { Arrow , classes , Cross } from "../picker-primitives" ;
10
9
11
10
interface SelectProps {
12
11
value : string ;
@@ -52,15 +51,20 @@ export const Select = observer(function Select(props: SelectProps): React.ReactE
52
51
>
53
52
< span className = { cls . toggle } > { props . value } </ span >
54
53
< div className = { `${ cls . root } -controls` } >
55
- < ClearButton
56
- cls = { cls }
57
- onClick = { ( ) => {
58
- props . onClear ( ) ;
59
- toggleRef . current ?. focus ( ) ;
60
- } }
61
- showSeparator = { false }
62
- visible = { showClear }
63
- />
54
+ { showClear && (
55
+ < div
56
+ className = { cls . clear }
57
+ tabIndex = { - 1 }
58
+ aria-label = "Clear combobox"
59
+ onClick = { event => {
60
+ event . stopPropagation ( ) ;
61
+ props . onClear ( ) ;
62
+ toggleRef . current ?. focus ( ) ;
63
+ } }
64
+ >
65
+ < Cross />
66
+ </ div >
67
+ ) }
64
68
< Arrow className = { cls . stateIcon } />
65
69
</ div >
66
70
</ button >
You can’t perform that action at this time.
0 commit comments