-
-
Notifications
You must be signed in to change notification settings - Fork 800
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
Duplicate clear icon in (date) input #791
Comments
I can only reproduce this in Firefox. It seems to me that Firefox itself inserts this clear button because if you remove the |
You're right. This only happens in Firefox. Not sure what I was thinking yesterday. |
So for Webkit-based browsers, there's a I've also seen this issue brought up in another component library, where they ended up implementing the entire picker themselves (not only because of this issue though). Other common approaches seem like hacks that I wouldn't want to use for this this: https://stackoverflow.com/questions/49527186/how-to-remove-cross-on-date-and-time-html-inputs-in-firefox Should Shoelace's clear button just always be hidden on Firefox then? |
Yeah I also didn't find something else to solve this. But in my opinion it is still better to use
I think this would be better than hiding the shoelace clear button because the clear button of Firefox:
What are you thinking about this, @claviska? If you both agree I can write a PR for that. |
This was a tough decision because there were zero browser sniffs in the library before 5f25049. After extensively researching ways around this, it appears as though @Buni48's However, I'm OK with the user agent sniff (and prefer it over feature detection of unrelated properties since those are likely to change over time) because, if it fails, the clear icon will simply become redundant. This fix should work perfectly for 99.9% of users, and anyone changing their UA string will simply see an extra icon but they won't lose any functionality. Until there's a better solution, e.g. a |
Describe the bug
Under certain conditions, the
sl-input
will show two clear icons.To Reproduce
Unclear so far.
Demo
https://codepen.io/oliversalzburg/pen/vYdMWOe?editors=1000
Screenshots
Browser / OS
The text was updated successfully, but these errors were encountered: