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

[feature request] Give autosuggest__results-container a class when the list is empty #98

Closed
wujekbogdan opened this issue Feb 25, 2019 · 3 comments

Comments

@wujekbogdan
Copy link

Could you give the .autosuggest__results-container a class when the array of suggestions is empty? It could be for example autosuggest__results-container--empty.

@wujekbogdan wujekbogdan mentioned this issue Feb 25, 2019
10 tasks
@darrenjennings
Copy link
Owner

Are there any aria attributes or anything that could yield this without having to toggle a class? I'm not against it, just wondering if class is the right attribute.

@wujekbogdan
Copy link
Author

Are there any aria attributes or anything that could yield this without having to toggle a class?

Probably aria-hidden="true" is the right one.

I'm not against it, just wondering if class is the right attribute.

It's perfectly valid to use a class with a modifier if we are to implement BEM-compatible classes #96

BEM methodology discourages from styling elements based on attributes. Of course, the aria- attribute is also valid but it should not be used for styling. It has a different purpose.

@darrenjennings
Copy link
Owner

Leaning on just requiring this in user land since the "no results" is the same as suggestions.length === 0 which would allow users to easily toggle a class on the component when there are no suggestions.

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