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

data-hidden broken in v1.13.0 #2140

Closed
McNetic opened this issue Nov 7, 2018 · 4 comments
Closed

data-hidden broken in v1.13.0 #2140

McNetic opened this issue Nov 7, 2018 · 4 comments

Comments

@McNetic
Copy link

McNetic commented Nov 7, 2018

The 'hidden' attribute of the tag should be handled as it is in a native select. That means: An option with the hidden attribute is not visible, unless it is selected (usually by also setting the selected attribute).

I know of at least two applications of hidden options: The first (which could be implemented with bootstrap-select otherwise) is the display of a greyed out message for selects with no option selected. The second is a simple way to provide the selected value when generating the list programmatically by simply adding the option with the selected value as an additional, hidden option (in some templating languages, it is quite complicated to only add the selected attribute to the right option).

A live example of both (with the corresponding native selects) is available.

@caseyjhol
Copy link
Member

I can't find any reference in the HTML spec to hidden being a valid option attribute (http://w3c.github.io/html-reference/option.html#option). Can you link me to anything?

Setting data-hidden="true" should be a viable workaround, but it looks like that's been partially broken since v1.13.0 (it works in v1.12.4). https://plnkr.co/edit/F0VgmOD4yCPoHuWKIkPV?p=preview

bootstrap-select does have a built-in way of dealing with what you're trying to do with the first application: set the title attribute on the select.

@caseyjhol caseyjhol changed the title Respect hidden attribute of options data-hidden broken in v1.13.0 Nov 7, 2018
@McNetic
Copy link
Author

McNetic commented Nov 8, 2018

hidden is a global attribute: https://w3c.github.io/html-reference/global-attributes.html and thus valid on all tags.

@caseyjhol
Copy link
Member

Great - thanks! I'll get data-hidden working as it should, and then throw in hidden support as well, since it's the same functionality.

@caseyjhol
Copy link
Member

Released in v1.13.4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants