Allow preservation of user specified high/low range value when out of bounds #5382
Replies: 0 comments 5 replies
-
I think since you've already looked so much into the details, you can create your forked version without issue, although I'd love to see what you create in a sandbox / repo or something like that. An example of a full custom widget would be for example ais-state-results here I think a better name for this parameter would be Thanks for opening an issue! |
Beta Was this translation helpful? Give feedback.
-
Ha! My variable name went through a lot of variations during my experiments. I'm pretty sure at once point in time or another Since this involves changes in two repositories ( |
Beta Was this translation helpful? Give feedback.
-
Before jumping to making a PR, we'll discuss this with the team so we can find possibly a different solution. I'll get back to you once we've discussed it, but otherwise it's just making two separate PRs, yes. |
Beta Was this translation helpful? Give feedback.
-
@Haroenv - was the ais-state-results "here" supposed to be a link to a fully custom widget? |
Beta Was this translation helpful? Give feedback.
-
yes, that was meant to be https://github.com/algolia/vue-instantsearch/blob/master/src/components/StateResults.vue @frostydustpile. |
Beta Was this translation helpful? Give feedback.
-
Allow Range Input to accept and maintain state of a minimum below the lowest in range, and/or a maximum higher than highest in product range.
What is your use case for such a feature
We use the Range Input for a price range selector. Unfortunately, it puts the burden of understanding the the high and low price boundaries on the customer. We also combine the information in the "selected filter" so that it reads more naturally (no mathematical syntax). In other words, we show the Selected Filter as a single
$50 to $150
instead of the>= $50
and<= $150
pair.Example:
Given:
When:
Then:
<= $150
>=$25
(we would then combine these into a single UI element:$25 to $150
- but that's beyond the scope of this feature request)The fact that the
>=$25
does nothing to reduce the product set is logically sensible from a programmer's standpoint. Why apply it if it does nothing? However, the disappearance of the low range and absence of confirmation via the selected filters can be disorienting to a customer who "thought" they were trying to restrict within a range. They may try again. Even when they see the number disappear (which they may not have explicitly noticed at first), they may not understand why and feel like they're doing something wrong, or get frustrated with the system not accepting their input.What is your proposal
Include an
unbounded
widget parameter to theRangeInput.vue
component that would allow the developer to override the default behavior and specify that the bounds need NOT be enforced (they would be by default to preserve present behavior & backwards compatibility):Then the connector would need to be updated to reflect this, which I think is pretty simple:
At this point, enabling the unbounded version of the Range Input would be as easy for the developer as adding the
unbounded
attribute to the component:What is the version you are using?
Other notes
I tried going down the route of making a custom widget and custom connector, but the documentation discourages this and prefers a feature request. 😄 Thus, this feature request. If there is anything in the way of a good example of creating a custom widget/connector for Vue, I'd love to see it.
Beta Was this translation helpful? Give feedback.
All reactions