-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(toggle): Allow custom on/off values
Fixes #409 Adds the `values` option to the `toggle` widget. Defaults to `{on: true, off: undefined}`. - It does not break previous API, new default value is retro-compatible - If `off` set to `undefined`, it will simply remove all filtering on this facet - If `off` set to anything else, it will allow toggling between `on` and `off` value when checking/unchecking the checkbox - If an `off` value is set and the results are not currently filtered on the `on` value at startup, then we add filtering on `off`. This helps in not creating an undefined state on first load. To test if a refinement was currently set on a specific value, I had to use `helper.state.isFacetRefined`, I did not found any method directly on the helper. Maybe I missed something.
- Loading branch information
1 parent
3f8eb9e
commit 9b6c2bf
Showing
4 changed files
with
175 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters