Skip to content
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

[Bug]: Caret overlaps with selected content #757

Open
nwalters512 opened this issue Aug 12, 2024 · 5 comments · May be fixed by #819
Open

[Bug]: Caret overlaps with selected content #757

nwalters512 opened this issue Aug 12, 2024 · 5 comments · May be fixed by #819
Labels
bug Something isn't working

Comments

@nwalters512
Copy link
Contributor

Bug description

This is visible with the "Theme" selector on the "Basic Examples" page: https://tom-select.js.org/examples/

Screenshot 2024-08-12 at 16 13 41

Expected behavior

I would expect the selected item to not overlap with the caret.

Steps to reproduce

  1. Visit https://tom-select.js.org/examples/
  2. Observe the visual overlap

Additional context

This visual bug appeared on all devices + browsers I tested with:

  • macOS Chrome
  • macOS Safari
  • macOS Firefox
  • iOS Safari
@nwalters512 nwalters512 added the bug Something isn't working label Aug 12, 2024
@nwalters512
Copy link
Contributor Author

From what I can tell, this is an issue with this:

https://github.com/orchidjs/tom-select/blame/69180fa9e79060060f1824fbde85537579d0005d/src/scss/tom-select.scss#L84

If I change the declaration of --ts-pr-clear-button from 0 to 0rem, the calculation works and the right padding is as expected. From what I can tell, 0 + 2rem just evaluates to 0 for some reason? Looking at the "Computed" styles for .ts-control in my browser devtools, padding-right is 0px when the display is broken.

@rproserpio
Copy link

0 is not unit-compatible so the resulting value is invalid.
But since a css variable is used, the rule is not invalid at parse time but at computed-value time, and has already overridden the fallback rules.

@MatTheCat
Copy link

MatTheCat commented Nov 28, 2024

Hit by this one and came to the same conclusion: --ts-pr-clear-button should have a unit even when it’s 0.

BTW the 1em value does not seem to match the “button”’s width. my mistake this was due to an override in my codebase 😓

I see this has been reported some months ago; should I open a PR?

@nwalters512
Copy link
Contributor Author

@MatTheCat a PR would be greatly appreciated!

@MatTheCat MatTheCat linked a pull request Nov 28, 2024 that will close this issue
@MatTheCat
Copy link

Here we go! #819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants