@@ -25,7 +25,7 @@ const SearchIcon = styled(Search)`
2525
2626const SearchbarWrapper = styled . div `
2727 border-radius: ${ ( { theme } ) => theme . borderRadius } ;
28- border: 1px solid ${ ( { theme } ) => theme . colors . neutral150 }
28+ border: 1px solid ${ ( { theme } ) => theme . colors . neutral150 } ;
2929
3030 &:focus-within {
3131 ${ SearchIcon } {
@@ -35,25 +35,44 @@ const SearchbarWrapper = styled.div`
3535` ;
3636
3737const SearchbarInput = styled ( Field . Input ) `
38- border: 1px solid ${ ( { theme } ) => theme . colors . neutral150 }
38+ border: 1px solid ${ ( { theme } ) => theme . colors . neutral150 } ;
3939 height: 16px;
4040 padding: 0 0 0 8px;
4141 color: ${ ( { theme } ) => theme . colors . neutral800 } ;
42-
42+
4343 &:hover {
4444 button {
4545 cursor: pointer;
4646 }
4747 }
4848
4949 ${ inputFocusStyle ( ) }
50+
51+ > input::-ms-clear {
52+ display: none;
53+ width: 0;
54+ height: 0;
55+ }
56+
57+ > input::-ms-reveal {
58+ display: none;
59+ width: 0;
60+ height: 0;
61+ }
62+
63+ > input::-webkit-search-decoration,
64+ > input::-webkit-search-cancel-button,
65+ > input::-webkit-search-results-button,
66+ > input::-webkit-search-results-decoration {
67+ display: none;
68+ }
5069` ;
5170
5271export interface SearchbarProps extends Field . InputProps {
5372 children : React . ReactNode ;
5473 name : string ;
5574 value ?: string ;
56- onClear : React . MouseEventHandler < any > ;
75+ onClear : React . MouseEventHandler < HTMLButtonElement > ;
5776 clearLabel : string ;
5877}
5978
@@ -78,9 +97,16 @@ export const Searchbar = React.forwardRef<HTMLInputElement, SearchbarProps>(
7897
7998 < SearchbarInput
8099 size = "S"
100+ type = "search"
81101 ref = { actualRef }
82102 value = { value }
83103 startAction = { < SearchIcon aria-hidden /> }
104+ onKeyDown = { ( e ) => {
105+ e . stopPropagation ( ) ;
106+ if ( e . key === 'Escape' && isCompleting ) {
107+ handleClear ( e ) ;
108+ }
109+ } }
84110 endAction = {
85111 isCompleting ? (
86112 < IconButton
0 commit comments