Closed wujekbogdan closed 5 years ago
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.
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 https://github.com/darrenjennings/vue-autosuggest/issues/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.
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.
Could you give the
.autosuggest__results-container
a class when the array of suggestions is empty? It could be for exampleautosuggest__results-container--empty
.