fix: issues
This commit is contained in:
@@ -16,7 +16,7 @@ customElement<MdCommanderProps>(
|
||||
|
||||
const commander = useCommander(props.commands);
|
||||
const [editingAttr, setEditingAttr] = createSignal<{
|
||||
itemId: string;
|
||||
index: number;
|
||||
attrName: string;
|
||||
attr: TrackerAttribute;
|
||||
} | null>(null);
|
||||
@@ -99,13 +99,13 @@ customElement<MdCommanderProps>(
|
||||
fallback={
|
||||
<TrackerView
|
||||
items={commander.trackerItems}
|
||||
onEditAttribute={(itemId, attrName, attr) =>
|
||||
setEditingAttr({ itemId, attrName, attr })
|
||||
onEditAttribute={(index, attrName, attr) =>
|
||||
setEditingAttr({ index, attrName, attr })
|
||||
}
|
||||
onRemoveClass={commander.removeTrackerItemClass}
|
||||
onMoveUp={(itemId) => commander.moveTrackerItem(itemId, "up")}
|
||||
onMoveDown={(itemId) => commander.moveTrackerItem(itemId, "down")}
|
||||
onRemove={commander.removeTrackerItem}
|
||||
onRemoveClass={commander.removeTrackerItemClassByIndex}
|
||||
onMoveUp={(index) => commander.moveTrackerItemByIndex(index, "up")}
|
||||
onMoveDown={(index) => commander.moveTrackerItemByIndex(index, "down")}
|
||||
onRemove={(index) => commander.removeTrackerItemByIndex(index)}
|
||||
/>
|
||||
}
|
||||
>
|
||||
@@ -146,7 +146,7 @@ customElement<MdCommanderProps>(
|
||||
onUpdate={(attr) => {
|
||||
const data = editingAttr();
|
||||
if (data) {
|
||||
commander.updateTrackerAttribute(data.itemId, data.attrName, attr);
|
||||
commander.updateTrackerAttributeByIndex(data.index, data.attrName, attr);
|
||||
}
|
||||
}}
|
||||
onClose={() => setEditingAttr(null)}
|
||||
|
||||
Reference in New Issue
Block a user