-
Notifications
You must be signed in to change notification settings - Fork 516
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
[numericSelector] Issue when selecting undefined #665
Comments
How can this happen that we display a value that will refine to undefined? |
See the dev/app.js, popularity selector. |
I am sorry the easiest way to report this bug or any UI bug is to quickly drop a GIF explaining it. So all devs will get the issue in no time VS having to try to understand the bug. Can you do that? |
Now I immediately get it, in particular the "undefined value" which I did not understand at all, thx |
Seems reasonable and should not introduce something people do not want. Also in terms of UX I would just not put any "Select a value" option in our demo app. Seems obvious that this select menu is.. for.. selecting a value. But rather set the default to the "default" sorting |
Not sure we should |
Indeed seems like a better idea. |
Will it be obvious for the user that an index is selected and which is the one selected? |
Also I'm not sure that having 2 index selector is such a good idea. One should change the other, right? |
Also if you change the index, the previously selected filters might not be relevant. How should we deal with that? |
We will always advocate for not having an "empty" value in the list, and always select the default one. But I'm ready to bet that some users will want to add an empty element (maybe because this is how their CMS forces them to do), so we need to handle that gracefully. Going back to default is the one that will raise the least surprise I guess.
Yes... I do not understand the UI either. Seems weird to me
That's also true, and I think we discussed it with @jerskouille and @redox in the past already. Not sure how to handle it, but that should be a different issue. |
I think that's the point of using clearRefinements. This way we avoid the weird effect of having unknown/non-applicable filters. An other strategy could be to leave the currently selected filters, and provide a way to discard the filters one by one with something like the widget proposed by @jerskouille #404. But then the user has to manually remove all the filters (may be lots of clicks). |
You can |
About the original issue and requirement ("Select a value"). Maybe we can add a "header" API option entry where you could add your own "Select a value". I feel that would fit the need pretty well and we would then have to document that if the user select the header then we select the default index. Then if the user passes an "undefined" value for the sortBySelector we should error and says this is not doable. Works? |
Was not working with `undefined` (linked with #665) Did not have the right operator nor the right values for the dataset
I added "need api proposal" to this one because relying on the "undefined" value to trigger a behavior like clear refinement and provide a "header like" feature is not clear enough for the user. |
What about simply passing the default index name as the value of the label entry? This would allow people to select the label entry. Regarding |
I do not understand: which |
Let me rephrase it. A common usecase for When putting it as first element, you still have to put a value, and in this bug report we had a user that puts an empty value. This resulted in trying to switch to an index named What I suggested was that if we see that there is not value set for the dropdown option, instead of passing But in the meantime, we can provide a workaround for this issue without having to code anything. We could simply tell our user to pass the default index name as the value for the |
As for sortBySelector, it may be an anti pattern to try to provide this option (showing "Select a sort"). Because there's always an index sort selected: the main one which should be the "most relevant" default option. As for numeric selector, I moved to #885. |
When selecting an option with the undefined value, we get an error back from Algolia.
We should probably just clearRefinements in that case.
The text was updated successfully, but these errors were encountered: