switch over to deep diffing for mutations
This commit is contained in:
parent
2e3a3e90de
commit
6064fd3b45
7 changed files with 228 additions and 88 deletions
|
@ -65,7 +65,7 @@ export const SelectionProvider: ParentComponent<{ selection?: SelectionHandler,
|
|||
length,
|
||||
select(selection, { mode = SelectionMode.Normal } = {}) {
|
||||
if (props.multiSelect === true && mode === SelectionMode.Normal) {
|
||||
mode = SelectionMode.Append;
|
||||
mode = SelectionMode.Toggle;
|
||||
}
|
||||
|
||||
setState('selection', existing => {
|
||||
|
@ -238,8 +238,7 @@ export const selectable = (element: HTMLElement, options: Accessor<{ value: obje
|
|||
const append = Boolean(modifier() & Modifier.Control);
|
||||
|
||||
const mode = (() => {
|
||||
if (append) return SelectionMode.Append;
|
||||
if (!withRange && isSelected()) return SelectionMode.Toggle;
|
||||
if (append) return SelectionMode.Toggle;
|
||||
if (withRange) return SelectionMode.Replace;
|
||||
return SelectionMode.Normal;
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue