[TW5] When I add a tag and hit ENTER, the tag is not saved

147 views
Skip to first unread message

Chuck R.

unread,
Jun 29, 2016, 11:59:59 AM6/29/16
to TiddlyWiki
I'd like an option in TW5 where, if I am entering a new tag, and I hit ENTER, the new tag is saved. Some people might prefer the old way of saving the tag (clicking the Add button). Would it be possible to add this feature in the future?

Thanks!

Mark S.

unread,
Jun 29, 2016, 2:02:58 PM6/29/16
to TiddlyWiki
I'd like that too -- the way it is now I have to take my hands off the keyboard to add, then go back, click in the box, type again, off the keyboard ... repeat. It would be great if you could type in series of tags, possibly comma delimited.

Mark

Eric Shulman

unread,
Jun 29, 2016, 2:47:19 PM6/29/16
to TiddlyWiki
On Wednesday, June 29, 2016 at 8:59:59 AM UTC-7, Chuck R. wrote:
I'd like an option in TW5 where, if I am entering a new tag, and I hit ENTER, the new tag is saved. Some people might prefer the old way of saving the tag (clicking the Add button). Would it be possible to add this feature in the future?

Currently, the <$edit-text> widget doesn't do anything with the enter key.  It also ignores any 'child content' (i.e., anything between <$edit-text> and </$edit-text>).  If we add a handler to $:/core/modules/widgets/edit-text.js to catch the enter key, we could then use it to trigger <$action> widgets defined as content of the $edit-text widget, just like the content of <$button>...</$button>.  If no action widgets are defined for the edit field, it would still work as it does today.

With this additional ability for the edit-text widget to invoke actions , we could then modify the $:/core/ui/EditTemplate/tags definition, changing this:
<$edit-text tiddler="$:/temp/NewTagName" .../>

to this:
<$edit-text tiddler="$:/temp/NewTagName" ...>
   <$action-sendmessage message="tm-add-tag" param={{$:/temp/NewTagName}}>
   <$action-setfield tiddler="$:/temp/NewTagName" text="">
</$edit-text>

Thus, as you type text, it is saved in $:/temp/NewTagName, and 'enter' invokes the action widgets to set the tag from the temp value, and then clear the tag input so it is ready to add another tag.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals

wimm

unread,
Jun 29, 2016, 5:02:34 PM6/29/16
to TiddlyWiki
if you use tagname TAB TAB SPACE to add the tag
you do not have to lift your hands from the keyboard

Njoy
WiM

Mark S.

unread,
Jun 29, 2016, 5:26:47 PM6/29/16
to TiddlyWiki
Thanks for pointing that out!

Mark

Chuck R.

unread,
Jun 30, 2016, 9:45:04 AM6/30/16
to TiddlyWiki
That would work fine. Thanks. I just wanted to move my hands less between the keyboard and mouse.

Mat

unread,
Jul 5, 2016, 4:58:41 AM7/5/16
to TiddlyWiki
Note also that anything not yet saved in the new tag field, as well as new custom fields, is by default stored when the tiddler is saved.

<:-)

Reply all
Reply to author
Forward
0 new messages