Skip to content

Commit f247a6f

Browse files
committed
[O2B-1502] Fixed logic and type
1 parent 9934e56 commit f247a6f

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

lib/public/components/Filters/LhcFillsFilter/StableBeamFilterModel.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class StableBeamFilterModel extends SelectionModel {
2424
*/
2525
constructor(value = false) {
2626
super({ availableOptions: [{ value: true }, { value: false }],
27-
defaultSelection: [{ value: value }],
27+
defaultSelection: [{ value }],
2828
multiple: false,
2929
allowEmpty: false });
3030
}
@@ -52,7 +52,15 @@ export class StableBeamFilterModel extends SelectionModel {
5252
* Get normalized selected option
5353
*/
5454
get normalized() {
55-
return this.selected[0];
55+
return this.current;
56+
}
57+
58+
/**
59+
* Overrides SelectionModel.isEmpty to respect the fact that stable beam filter cannot be empty.
60+
* @returns {boolean} true if the current value of the filter is false.
61+
*/
62+
get isEmpty() {
63+
return this.current === false;
5664
}
5765

5866
/**

lib/public/components/common/form/inputs/radioButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { h } from '/js/src/index.js';
2020
*/
2121

2222
/**
23-
* @typedef RadioButtonConfig - configration object for radioButton.
23+
* @typedef RadioButtonConfig - configuration object for radioButton.
2424
*
2525
* @property {string} label - label to be displayed to the user for radio button
2626
* @property {boolean} isChecked - is radio button selected or not

0 commit comments

Comments
 (0)