Focus on the body when entered into edit?

Hi

Is it possible to focus on the body text editing area instead of the title when entered into the edit mode of an existing note? The edit mode edit goes into the title editing first which is not necessary for editing an existing note in my opinion. It creates unnecessary user friction. It is extra friction on mobile too.

1 Like
  1. Open $:/ControlPanel > Info > Basics tab
  2. Scroll to the “Default focus field for new tiddlers” setting
  3. Choose “text”
2 Likes

This is cool, but why isn’t it default?

  • I imagine because if you use the + or New Here buttons then the title will be “New Tiddler N” and you will want to rename it.
    • In fact edit is the only way to rename a tiddler
  • True if the New tiddler actions defaulted to the title and the edit to the text it may make more sense
    • however when the text field gains the focus, the text is also selected, you just need to bump the famous “any key” and the whole text is replaced eg “space key”.
1 Like

I just deleted a post that echoed Marovian, whilst using mobile phone and keyboard I sometimes wiped out existing tiddler titles unintentionally whilst editing - not as ergonomic as laptop - mistakes and unintentional keystrokes happen. Its not a massive issue - I just quit edit without saving and try again to edit so as not to lose the title.

I removed comment - it’s worse if I accidentally wipe out the body text of the tiddler - it’s am and I am on first coffee - not thinking straight yet.

I am changing default back to title until I have experimented properly.

2 Likes

Yes, Focused text without selection would be nice for editing tiddlers, title selection with selection for new tiddlers.

1 Like

Sorry this landed in the wrong thread…

I think there’s potential for a nice UX improvement here.

  • The default focus should be the title for brand new tiddlers, and the text for existing tiddlers.
  • Selecting the entire text is a bad idea. Let’s make it not to that, unless it’s a brand new tiddler and the focus is “title”.

With this default behavior I think it would be reasonable to remove $:/config/AutoFocus entirely, but if we want to preserve it for the people who don’t like the defaults, I guess we’ll need more config options, something like this maybe:

  • $:/config/AutoFocus - field name as it is now, but the default should be “text”
  • $:/config/AutoSelectAll - true or false, with default “false” so we don’t select the entire tiddler content
  • $:/config/AutoFocusNew - field name for new tiddlers, the default should be “title”
  • $:/config/AutoSelectAllNew - true or false, with default “true” so we can quickly type a tiddler name when creating

Does it seem like a good idea? Would it be worth adding this proposal to Issues · Jermolene/TiddlyWiki5 · GitHub?

5 Likes

In addition, apropos UX:

I’m currently working on a soon-to-be-released thingy, that includes a live search mechanism where the search results are presented as fully transcluded tiddlers. But the autofocus steals the focus from the search field, interrupting the users typing.

So, I wish it was possible to disable autofocus for/from transcluded tiddlers.

1 Like

Currently, the $edit-text widget supports a focus="yes" parameter, which is handled by

$:/core/modules/editor/engines/simple.js, here:

SimpleEngine.prototype.focus  = function() {
	if(this.domNode.focus && this.domNode.select) {
		this.domNode.focus();
		this.domNode.select();
	}
};

and by $:/core/modules/editor/engines/framed.js, here:

FramedEngine.prototype.focus  = function() {
	if(this.domNode.focus && this.domNode.select) {
		this.domNode.focus();
		this.domNode.select();
	}
};

Note that these functions not only set the input focus on the domNode, but they also select the domNode contents.

In order to support the proposed new behavior, this handling would need to be re-written. I suggest adding a new select="no" parameter to the $edit-text text widget so that the current hard-coded behavior can be bypassed if desired.

Note that, for backward compatibility, the default when this new parameter is omitted must be to still select the domNode contents as it presently does.

1 Like

I did create an issue at GH: [IDEA] it is proposed to add a "select" parameter to the edit-text widget · Issue #7221 · Jermolene/TiddlyWiki5 · GitHub

2 Likes

If we try and be exhaustive with these focus and select options there are cases where someone may wish to use focus and not select text with the editor button yet want easy access to renaming tiddlers.

  • perhaps a rename tiddler button?
  • that does the current default focus and select title