Summary
Boolean fallback values in TreeView use || false instead of nullish coalescing, which can lead to incorrect behavior for configuration options.
Steps to Reproduce
const foo = new HSTreeView(element, {
isIndeterminate: false,
});
console.log(foo.isIndeterminate);
Source:
|
this.isIndeterminate = concatOptions?.isIndeterminate || true; |
Demo Link
https://stackblitz.com/edit/preline-4-1-3-react-vite
Expected Behavior
The fallback should only apply when the value is null or undefined.
Actual Behavior
|| checks for truthiness instead of existence, so falsy values are treated as missing values.
Screenshots
No response
Summary
Boolean fallback values in
TreeViewuse|| falseinstead of nullish coalescing, which can lead to incorrect behavior for configuration options.Steps to Reproduce
Source:
preline/src/plugins/tree-view/core.ts
Line 53 in 1cd9636
Demo Link
https://stackblitz.com/edit/preline-4-1-3-react-vite
Expected Behavior
The fallback should only apply when the value is
nullorundefined.Actual Behavior
||checks for truthiness instead of existence, so falsy values are treated as missing values.Screenshots
No response