-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style(inputsearch): change default html clear icon #607
Changes from 2 commits
c4096a8
58e8be7
0197fed
d1dcf20
cbfab43
2ec4550
2c12150
e8b456d
0dad97c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,8 +100,9 @@ const InputSearch = forwardRef<HTMLDivElement, InputSearchProps>( | |
sdsStyle={sdsStyle} | ||
sdsStage={hasValue ? "userInput" : "default"} | ||
onChange={handleChange} | ||
onKeyPress={handleKeyPress} | ||
onKeyDown={handleKeyPress} | ||
intent={intent} | ||
autoComplete="off" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add this comment in the code too for context! |
||
{...rest} | ||
/> | ||
</> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { | |
TextField, | ||
} from "@mui/material"; | ||
import { styled } from "@mui/material/styles"; | ||
import xMark from "../../common/svgs/IconXMarkSmall.svg"; | ||
import { | ||
CommonThemeProps, | ||
fontBodyM, | ||
|
@@ -116,6 +117,18 @@ export const StyledSearchBase = styled(TextField, { | |
min-width: 120px; | ||
display: block; | ||
|
||
[type="search"]::-webkit-search-cancel-button { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part hides the default HTML clear icon. |
||
-webkit-appearance: none; | ||
appearance: none; | ||
height: 14px; | ||
width: 14px; | ||
background-color: ${colors?.primary[400]}; | ||
-webkit-mask-image: url(${xMark}); | ||
mask-image: url(${xMark}); | ||
background-size: 14px 14px; | ||
cursor: pointer; | ||
} | ||
|
||
.${outlinedInputClasses.root} { | ||
.${outlinedInputClasses.notchedOutline} { | ||
border: ${borders?.gray[400]}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onKeyPress event has been deprecated and replaced by the newer onKeyDown event.