diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 4fd8932d..9cfde227 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -296,29 +296,30 @@ class Vbox extends preact.Component { } return false; }) ? 'combo-border' : ''; - function onClick(e) { + function onClick(type) { if (vboxSelecting) clearVboxSelected(); if (reclaiming) return sendVboxReclaim(i); + const combinerContainsIndex = combiner.indexOf(i) > -1; // 4 things selected - if (combiner.length > 2) { + if (combiner.length > 2 && !combinerContainsIndex) { setInfo(vbox.bound[i]); return combinerChange([i]); } // removing - const combinerIndex = combiner.indexOf(i); - if (combinerIndex > -1) { + if (combinerContainsIndex) { + if (type === 'click') { + return combinerChange(without(combiner, i)); + } return true; - // return combinerChange(without(combiner, i)); } - combiner.push(i); - - if (!comboHighlight) { + if (!comboHighlight && !combinerContainsIndex) { setInfo(vbox.bound[i]); return combinerChange([i]); } + combiner.push(i); return combinerChange(combiner); } @@ -332,17 +333,14 @@ class Vbox extends preact.Component {