How is focus set on title in editview?

I’m making a button that creates a new editmode tiddler but I want the focus to be set on the title, just like when clicking TWs native New tiddler button. I’m guessing I should use tm-focus-selector but what’s the $param? (btw, the linked doc says there is no $ prefix on param but the core code does seem to use it)

<$button> new
<$action-sendmessage $message="tm-new-tiddler" tags="foo" />
<$action-sendmessage $message="tm-focus-selector" $param="????????" />
</$button>

Various core code tiddlers imply that $param should be some css class (e.g tc-titlebar tc-edit-texteditor - which doesn’t work) but the values used in the core are constructed in some cryptic ways…

Thanx!

OK, so this is the reason why I’m asking: https://add-sibling.tiddlyhost.com

As noted there, it is [intended to become] a small plugin for the community to easily create sibling tiddlers, i.e a tiddler tagged with the tag you’re fiddling with.

So, again, I’m hoping that the created editview tiddler can have its title field focussed, just like when creating new tiddlers.

Anyone?

Suggest sharing a minimal example without other plugins and customizations.

1 Like

Somehow @TW_Tones solved this problem in the “reimagin[e] Tags” package. I don’t think there’s a hosted version… and I’m having trouble finding a link to it. But I do have a version (not sure if it’s the most recent) operating at my quick-demo site. Click on a tag, and there are a bunch of things in the dropdown menu, including “new tiddler with this tag” — and selecting that does put the title text-entry in focus.

1 Like

Ouch, how embarrassing… because when setting this up it works! An empty TW with only the relevant bits does set focus on the title field in ediview.

Thank you @saqimtiaz and, everyone, sorry for my mistake!

Now I need to instead find out why it doesn’t work in my regular loaded TW…

2 Likes
\define sqr-open() [[
\define sqr-close() ]]
<$button tooltip="New tiddler with this Tag" class="tc-btn-invisible">
   <$action-createtiddler $basetitle={{$:/language/DefaultNewTiddlerTitle}} $savetitle="$:/temp/tiddlername"/>
   <$action-setfield $tiddler={{$:/temp/tiddlername}} $field="tags" $value={{{ [<currentTiddler>format:titlelist[]] }}} />
   <$action-sendmessage $message="tm-edit-tiddler" $param={{$:/temp/tiddlername}}/>
   {{$:/core/images/new-here-button}} New tiddler with this tag
</$button>

code attribution: @TW_Tones

1 Like

@Springer - hold it! See my message above. My mistake!

1 Like

Did you change your $:/ControlPanel setting (Info > Basics > “Default focus field for new tiddlers”)?

-e

1 Like

That is indeed what I had changed! Thanks @EricShulman