blockly > dialog > setPrompt

dialog.setPrompt() function

Sets the function to be run when Blockly.dialog.prompt() is called.

**Important**: When overridding this, be aware that non-native prompt experiences may require managing ephemeral focus in FocusManager. This isn't needed for the native window prompt because it prevents focus from being changed while open.

Signature:

export declare function setPrompt(promptFunction?: (message: string, defaultValue: string, callback: (result: string | null) => void) => void): void;

Parameters

Parameter Type Description
promptFunction (message: string, defaultValue: string, callback: (result: string | null) => void) => void (Optional) The function to be run, or undefined to restore the default implementation.

Returns:

void