@@ -19,17 +19,17 @@ export class ToggleFilterModel extends SelectionModel {
1919 /**
2020 * Constructor
2121 * @param {boolean } toggledByDefault If the filter should be toggled by default
22- * @param {boolean } falseIsEmpty if true, will treat false as empty.
22+ * @param {boolean } untoggledIsEmpty if true, will treat the untoggled state ( false) as empty.
2323 */
24- constructor ( toggledByDefault = false , falseIsEmpty = false ) {
24+ constructor ( toggledByDefault = false , untoggledIsEmpty = false ) {
2525 super ( {
2626 availableOptions : [ { value : true } , { value : false } ] ,
2727 defaultSelection : [ { value : toggledByDefault } ] ,
2828 multiple : false ,
2929 allowEmpty : false ,
3030 } ) ;
3131
32- this . _falseIsEmpty = falseIsEmpty ;
32+ this . _untoggledIsEmpty = untoggledIsEmpty ;
3333 }
3434
3535 /**
@@ -52,18 +52,15 @@ export class ToggleFilterModel extends SelectionModel {
5252
5353 /**
5454 * Determines whether the current value should be considered empty.
55- *
56- * By default (`falseIsEmpty = false`), this model never treats its value
57- * as empty—both `true` and `false` are considered valid selections.
58- *
59- * If `falseIsEmpty = true`, then a value of `false` is treated as empty.
55+ * When this._falseIsEmpty is set to 'true', then a 'false' selection (untoggled)
56+ * will be treated as an empty filter
6057 *
6158 * @return {boolean } `true` if the current value is considered empty,
6259 * otherwise `false`.
6360 */
6461 get isEmpty ( ) {
65- if ( this . _falseIsEmpty ) {
66- return this . current === false ;
62+ if ( this . _untoggledIsEmpty ) {
63+ return this . isToggled === false ;
6764 }
6865
6966 return false ;
0 commit comments