Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/gui/MacroGUIs/CommandList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ const asConditional = (c: ICommand) => c as IConditionalCommand;

function handleConsider(e: CustomEvent<DndEvent>) {
let { items: newItems } = e.detail;
commands = newItems as ICommand[];
// Drop svelte-dnd-action's internal shadow placeholder so a command can't
// linger in state and vanish on reorder (ghost gap) — mirrors the Settings
// choice list fix (#883).
commands = (newItems as ICommand[]).filter(
(c) => c.id !== SHADOW_PLACEHOLDER_ITEM_ID
);
Comment on lines +66 to +68
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the dragged command during consider

In the pointer-drag path, svelte-dnd-action's first consider event replaces the dragged item with the shadow placeholder; filtering it here means commands (and the dndzone's next items config) temporarily no longer contains the dragged command at all. If the user releases before a later over-index event re-inserts a shadow item, such as a tiny drag or dropping outside immediately after drag starts, handleSort receives that shortened list and saveCommands(commands) persists the macro with the command removed. Keep the dragged command represented in state during consider (or restore it before finalize) rather than dropping the placeholder from the dndzone items.

Useful? React with 👍 / 👎.

}

function handleSort(e: CustomEvent<DndEvent>) {
Expand All @@ -69,7 +74,9 @@ const asConditional = (c: ICommand) => c as IConditionalCommand;
info: { source },
} = e.detail;

commands = newItems as ICommand[];
commands = (newItems as ICommand[]).filter(
(c) => c.id !== SHADOW_PLACEHOLDER_ITEM_ID
);

if (source === SOURCES.POINTER) {
dragDisabled = true;
Expand Down
Loading