weixin_39613188
weixin_39613188
2021-01-06 18:26

Toggle issue

Related to #219 .

The toggle widget doesn't really do what it does : it just checks, when enabled, that a facet is true. However, there is no way to toggle it to false, making its behaviour different from what its name could make us think.

The behaviour I expect from a toggle button is a binary behaviour: http://www.bootstrap-switch.org/examples.html , and right now when the checkbox is unchecked, we're actually in the Indeterminate example of this page.

该提问来源于开源项目:algolia/instantsearch.js

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39629679 weixin_39629679 4月前

    Relevant discussions also: https://github.com/algolia/instantsearch.js/issues/41#issuecomment-128375498

    We had trouble naming this one or finding a good API that allow both use cases in an easy to understand way.

    Do you have any idea how to make it clearer/better. For sure this issue will be raised by people :)

    点赞 评论 复制链接分享
  • weixin_39613188 weixin_39613188 4月前

    What about something like constantFilter ? This would allow this one to be more generic, and could even maybe even accept an optional operator to handle use cases like Past week or Past month, etc. or My favorites (which would be favorited_by_ids:my_id), etc. WDYT ?

    点赞 评论 复制链接分享
  • weixin_39613188 weixin_39613188 4月前

    Actually, Past week, past month would require a list so it should probably go in another widget. But My favorites still makes sense to me.

    点赞 评论 复制链接分享
  • weixin_39629679 weixin_39629679 4月前

    Clsoing in favor of #409

    点赞 评论 复制链接分享

相关推荐