Skip to content

processTag("input") returns empty string for both Cancel and OK (empty) – how to detect Cancel? #621

Description

@bernhardsiegel

Hi,

I'm using QuickText v6.7.2 with scripts and trying to distinguish between a user clicking Cancel vs. clicking OK with empty input when using this.quicktext.processTag("input", ...).

So a question like "anything to add?" should not cancel the script when empty input is provided.

Current behaviour:
Both actions return an empty string "", making it impossible to detect if the user cancelled the dialogue or just submitted an empty input.

let answer = await this.quicktext.processTag("input", "Message", "text");
console.log(answer); // <empty string> for BOTH Cancel AND OK (empty)

Expected behaviour:
Ideally, Cancel should return null (or a distinct value like undefined/false), similar to the native window.prompt() behaviour, which returns:

null → Cancel
<empty string> → OK with empty input

Question:
Is this the intended behaviour of processTag("input")? If so, how can I reliably detect that the user clicked Cancel instead of submitting an empty string?

Workaround:
Currently, I’m using window.prompt(), which seems to work.

Thanks for your help!

/cc @jobisoft

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions