This commit is contained in:
Buni48
2022-06-19 18:37:38 +02:00
parent 4a6c37ae0c
commit 1c23daa3b1
2 changed files with 11 additions and 1 deletions

View File

@@ -280,4 +280,9 @@ export default css`
::-ms-reveal {
display: none;
}
/* Don't show the firefox clear icon in Firefox */
.hide-firefox-clear-icon {
clip-path: inset(0 2em 0 0);
}
`;

View File

@@ -301,6 +301,8 @@ export default class SlInput extends LitElement {
const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
const hasClearIcon =
this.clearable && !this.disabled && !this.readonly && (typeof this.value === 'number' || this.value.length > 0);
const isFirefox = typeof window.InstallTrigger !== 'undefined';
const hideFirefoxClearIcon = isFirefox && (this.type === 'date' || this.type === 'time');
return html`
<div
@@ -351,7 +353,10 @@ export default class SlInput extends LitElement {
<input
part="input"
id="input"
class="input__control"
class="${classMap({
input__control: true,
'hide-firefox-clear-icon': hideFirefoxClearIcon
})}"
type=${this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}
name=${ifDefined(this.name)}
?disabled=${this.disabled}