Closed Munksgaard closed 4 months ago
It seems like this choice was made on purpose, but I'm not sure I understand why: https://github.com/maxmarcon/live_select/commit/a05401732c2b3caa6877af98ff9b888edf4a2e1f
Should it not be possible to override the styling for clear_button
and clear_tag_button
separately?
That's because the button to clear the tag is only used in tags
mode (multiple selection), whereas the button to clear the selection is only used in single
mode (single selection).
So there's no chance of them colliding if your LiveSeelct doesn't dynamically switch between tags to single mode.
Aha, I see. The reason why I am trying to override both buttons at the same time, is because I've created a component as suggested here and wanted to apply all my custom branded styling in one place.
If I understand you correctly, if I want the clear_button
(for single selection) and the clear_tag_button
(for multiple selection) styling to be different, I'll have to create two separate components?
Yes, at the moment this is what you should do. A component for multiple selection and one for single selection.
I can see however how this choice of reusing the same name for different styling options is a bit lazy and can lead to confusion. We should change this.
I'll change the name of this issue accordingly, thanks
Feel free to write PR for this if you feel like it @Munksgaard !
According to the documentation,
clear_tag_button
uses theclear_button_class
andclear_button_extra_class
to override and extend the styling. However, The default classes forclear_button
andclear_tag_button
are different, meaning that if I attempt to override the class of one, the other will inadvertently also be overwritten. Here are what the docs currently look like:I would expect
clear_tag_button
to useclear_tag_button_class
andclear_tag_button_extra_class
instead, but I get an error if I try to use those.