Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Feature: multiline input with `tp.system.prompt`

Open AB1908 opened this issue 1 year ago • 1 comments

I've added a new multi-line input prompt inspired by chhoumann/QuickAdd. See here for original.

It can be invoked using

let default_value = "Original";
let prompt_text = "Prompt Title Here";
let throw_on_cancel = false;
let multi_line = true;
tR += await tp.system.prompt(prompt_text, default_value, throw_on_cancel, multi_line);

Sample: image

This is an optional variable that shouldn't introduce any breaking changes. I haven't had a chance to test this on mobile.

Note: the event handler for mobile behaves slightly differently. For multi-line inputs, the Submit button must be used as the enter key moves the cursor to the next line.

Please let me know if there's any cleanup I should do.

AB1908 avatar Jul 18 '22 12:07 AB1908

If anyone needs this, feel free to install 1.13.0 from my fork via BRAT.

AB1908 avatar Jul 18 '22 12:07 AB1908

I did that for the brat thing. I'll split that off into a separate branch next time.

AB1908 avatar Sep 02 '22 06:09 AB1908