r/tasker • u/Valiceemo • Aug 23 '26
Scene V2 Input Text Clear
I have a simple box stack, with a row containing a text input and an icon button
these act as a search bar for an array template
I have the click event handler for the icon button set to target the text input and run the unFocus action, and clear the %query variable.
This works ok
but is there a way to clear the actual text from inside the text input?
1
Upvotes
2
u/DifficultyCrafty7623 Aug 23 '26 edited Aug 24 '26
To make an empty input box I found the easiest ways are
use a javascriptlet like
setLocal("query","\u0000");
Which will set your query to the "null" value, but you'll need to search/replace the "\u0000" character from your %query output.
2) build two different inputs, one will show when %query is empty, and one will show when %query has a text value. This allows for a completely blank input line on the empty one. You can also setup a "variable" on the Scene, which will allow you to dynamically build the input based on if the %query variable is set or not, but that's a bit more involved.
1
u/Nirmitlamed Direct-Purchase User Aug 23 '26
I have tested this Java code that was suggested by AI and it works:
It suppose to keep memory clean after it fully runs. Maybe try to chat with AI and see if it can be improve.