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) {
|
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;
|
const selected = vboxSelected[0] === group && vboxSelected[1] === index;
|
||||||
|
|
||||||
// state not yet set in double click handler
|
// state not yet set in double click handler
|
||||||
@ -219,6 +219,7 @@ class Vbox extends preact.Component {
|
|||||||
onClick(ev);
|
onClick(ev);
|
||||||
ev.dataTransfer.setData('text', '')
|
ev.dataTransfer.setData('text', '')
|
||||||
}}
|
}}
|
||||||
|
key={(group + 1) * index}
|
||||||
onDragEnd={clearVboxSelected}>
|
onDragEnd={clearVboxSelected}>
|
||||||
<button
|
<button
|
||||||
class={classes}
|
class={classes}
|
||||||
@ -278,7 +279,7 @@ class Vbox extends preact.Component {
|
|||||||
const inventoryHighlight = vboxSelecting || itemUnequip.length;
|
const inventoryHighlight = vboxSelecting || itemUnequip.length;
|
||||||
|
|
||||||
if (!v && v !== 0) {
|
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]);
|
const combinerItems = combiner.map(j => vbox.bound[j]);
|
||||||
@ -330,6 +331,7 @@ class Vbox extends preact.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<label
|
<label
|
||||||
|
key={i}
|
||||||
draggable='true'
|
draggable='true'
|
||||||
onDragStart={ev => {
|
onDragStart={ev => {
|
||||||
onClick(ev);
|
onClick(ev);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user