On Thursday, April 2, 2020 at 7:53:20 AM UTC-7, si wrote:
>
> Thanks a lot - I didn't know about the range widget.
> I added it to a tag pill popup and it works if select a specific point on
> the line, but the dragging mechanism doesn't work:
> Do you know why this doesn't work within a popup and if there's a way to
> fix this?
>
When you use an input control (edit-text, range, textarea) to change a
field value in the current tiddler, it causes that tiddler to be
refreshed. When this occurs, the control is automatically re-rendered and
it loses the input focus and doesn't get any subsequent keystrokes or drag
events. Fortunately, there is a workaround that will allow you to make
multiple input events without losing focus by putting the control(s) into a
separate tiddler that is tagged with $:/tags/ViewTemplate
For your purposes, do this:
Create a separate tiddler (e.g., "ToDoTemplate") containing your controls
in the body text. Something like this:
<$range field="priority" min="1" max="100" default="50" increment="1"/>
{{!!priority}}
Tag this tiddler with $:/tags/ViewTemplate. This will cause your controls
will now appear at the bottom of every tiddler (below any tiddler text
content).
To make the controls appear above the tiddler text (as shown in your
example gif), edit the "ToDoTemplate" and add a field named "list-before"
with a value of "$:/core/ui/ViewTemplate/body"
To limit the appearance of your controls to selected tiddlers, you can wrap
the ToDoTemplate content inside a conditional display, by using the $list
widget to check for a specific tag value (e.g., "ToDo"), like this:
<$list filter="[<currentTiddler>tag[ToDo]]">
<$range field="priority" min="1" max="100" default="50" increment="1"/>
{{!!priority}}
</$list>
Then, for any tiddler in which you want the controls to appear, give that
tiddler a tag of "ToDo"
Let me know how it goes.
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/696b8a48-f9e3-45e1-b36e-491af1c8ad8f%40googlegroups.com.