mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-15 20:25:18 +02:00
Always hide remove button if no value is selected
In some cases, the remove item X button is not hidden when there is no selection made from the dropdown. This is not as usable, since there's no item to clear, hence an effective noop. The condition I saw seeing this issue arise is in single selects with a placeholder value, a selection has been made, and then cleared: the button HTML remains. To fix, add some styles to hide the button if the select doesn't have a value selected, in this case keying off of it's parents `data-value` property. fixes #684
This commit is contained in:
parent
b5b593a62f
commit
363b3b4fc4
|
@ -72,6 +72,10 @@
|
|||
box-shadow: 0px 0px 0px 2px #00bcd4;
|
||||
}
|
||||
|
||||
.choices[data-type*='select-one'] .choices__item[data-value=''] .choices__button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.choices[data-type*='select-one']:after {
|
||||
content: '';
|
||||
height: 0;
|
||||
|
|
2
public/assets/styles/choices.min.css
vendored
2
public/assets/styles/choices.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -83,6 +83,9 @@ $choices-icon-cross-inverse: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiI
|
|||
box-shadow: 0px 0px 0px 2px $choices-highlight-color;
|
||||
}
|
||||
}
|
||||
.#{$choices-selector}__item[data-value=''] .#{$choices-selector}__button {
|
||||
display: none;
|
||||
}
|
||||
&:after {
|
||||
content: '';
|
||||
height: 0;
|
||||
|
|
Loading…
Reference in a new issue