Import-Befehl: autoRun statt onConfirm — Datei-Dialog oeffnet synchron in der Geste
This commit is contained in:
@@ -26,6 +26,16 @@ export const importCommand: Command = {
|
|||||||
options: () => [],
|
options: () => [],
|
||||||
init: () => ({ ...IDLE }),
|
init: () => ({ ...IDLE }),
|
||||||
|
|
||||||
|
// Sofort-Befehl (wie Join/Split): `startCommand` ruft `autoRun` SYNCHRON im
|
||||||
|
// selben Aufruf-Stack wie die Enter-/Klick-Geste auf. Genau das braucht der
|
||||||
|
// Datei-Dialog — ein `<input type=file>.click()` öffnet den OS-Dialog nur
|
||||||
|
// innerhalb einer echten Nutzer-Geste; ein State-Update/async-Hop dazwischen
|
||||||
|
// (wie beim reinen onConfirm/onInput-Weg) lässt ihn verzögern oder ausbleiben.
|
||||||
|
autoRun: (): CommandResult => {
|
||||||
|
openDxfImport();
|
||||||
|
return { draft: null, done: true };
|
||||||
|
},
|
||||||
|
|
||||||
// Der Befehl hat keine Schritte: Start/Enter/Input öffnet den Dialog + endet.
|
// Der Befehl hat keine Schritte: Start/Enter/Input öffnet den Dialog + endet.
|
||||||
onInput: () => open(),
|
onInput: () => open(),
|
||||||
onMove: (state): [CommandState, CommandResult] => [state, { draft: null }],
|
onMove: (state): [CommandState, CommandResult] => [state, { draft: null }],
|
||||||
|
|||||||
Reference in New Issue
Block a user