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

Height on narrow selects is too tall #85

Closed
danstewart opened this issue May 14, 2021 · 6 comments
Closed

Height on narrow selects is too tall #85

danstewart opened this issue May 14, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@danstewart
Copy link

Describe the bug
Inner input is visible for narrow selects, even with a default value.

To Reproduce
Steps to reproduce the behavior:

  1. Create a select with a width a bit bigger than the contents

Here is a JSFiddle showing the issue:
https://jsfiddle.net/3yjzwhaq/

Expected behavior
Input should be hidden if a value is set.
It looks like when manually selecting a value the input is given the following styles:

style="opacity: 0; position: absolute; left: -10000px;"

Additional context
Add any other context about the problem here.

  • OS: [Ubuntu 20.04]
  • Browser [Firefox]
  • Version [88.0.1]
  • Device: [Desktop]

Tested with same result on Chromium 90.0.4430.212


Manually setting the style is a good workaround:

document.querySelector('#my-select-tomselected').style = "opacity: 0; position: absolute; left: -10000px"
@danstewart danstewart added the bug Something isn't working label May 14, 2021
@oyejorge
Copy link
Member

Here's a CSS only workaround as well

.input-hidden > .ts-input > input{
  display:none !important;
}

@oyejorge
Copy link
Member

Thanks! I'll have an updated release out shortly

@danstewart
Copy link
Author

Nice one, thanks a lot!

@iazaran
Copy link

iazaran commented May 19, 2021

This one can hide it just if it has value:

.ts-input.has-items > input {
    display: none !important;
}

@oyejorge
Copy link
Member

This one can hide it just if it has value:...

Yeah, that was a bad suggestion on my part

@danstewart
Copy link
Author

danstewart commented Mar 24, 2022

Workaround for V2:

.ts-wrapper.has-items > .ts-control > input {
    display: none !important;
}

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

No branches or pull requests

3 participants