fix vbox button flashing by adding key to mapped btns
This commit is contained in:
parent
8b4c616629
commit
79f1712864
@ -177,7 +177,7 @@ class Vbox extends preact.Component {
|
||||
}
|
||||
|
||||
function availableBtn(v, group, index) {
|
||||
if (!v) return <button disabled class='empty' > </button>;
|
||||
if (!v) return <button disabled class='empty' key={(group + 1) * index} > </button>;
|
||||
const selected = vboxSelected[0] === group && vboxSelected[1] === index;
|
||||
|
||||
// state not yet set in double click handler
|
||||
@ -219,6 +219,7 @@ class Vbox extends preact.Component {
|
||||
onClick(ev);
|
||||
ev.dataTransfer.setData('text', '')
|
||||
}}
|
||||
key={(group + 1) * index}
|
||||
onDragEnd={clearVboxSelected}>
|
||||
<button
|
||||
class={classes}
|
||||
@ -278,7 +279,7 @@ class Vbox extends preact.Component {
|
||||
const inventoryHighlight = vboxSelecting || itemUnequip.length;
|
||||
|
||||
if (!v && v !== 0) {
|
||||
return <button disabled={!inventoryHighlight} class={inventoryHighlight ? 'receiving' : 'empty'} > </button>;
|
||||
return <button key={i} disabled={!inventoryHighlight} class={inventoryHighlight ? 'receiving' : 'empty'} > </button>;
|
||||
}
|
||||
|
||||
const combinerItems = combiner.map(j => vbox.bound[j]);
|
||||
@ -330,6 +331,7 @@ class Vbox extends preact.Component {
|
||||
|
||||
return (
|
||||
<label
|
||||
key={i}
|
||||
draggable='true'
|
||||
onDragStart={ev => {
|
||||
onClick(ev);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user