Choosing the height of the text editor

One thing I find generally great about TW is that it gets out of my way when I just want to throw some notes at it, and easy to tweak the basics of the interface when I want that.

However, one spot where I find it’s regularly niggling in the size of the editor text area.

TW5 provides two options - auto, or fixed:

2025-07-01T13:34:11_6076be30

…neither of which I find comfortable for my use, and both of which override the browser- provided resize handle which is always my preferred option (and much faster than click a button to open a menu and type a number)

If there is a TW code method to override this, it’s definitely beyond my skills at the moment!

Anyway, am I the only one who finds this frustrating? Is there a technical reason that “let the user resize through the browser mechanism” is not an option? (could it be that this resize option predates browsers making text edit widgets resizable?)

1 Like

Quick reply:

At least one of my edit-templates does successfully use the resize handles for a bunch of custom edit areas…

Check out this sample, where the resize-boxes do work, and find the “tinker” link in red for the edit template

https://ethicsatwes.tiddlyhost.com/#Draft%20of%20’%24%3A%2Fsample-edit-interface’

In order for the tiddler editor toolbar buttons to perform their functions, the tiddler editor textarea is contained within an iframe. This is done so that the textarea can retain its separate input focus, which preserves the current cursor position and text selection so they can be used by the editor toolbar buttons to modify the textarea content. Unfortunately, the iframe wrapper also prevents the text area from being manually resized via the browser-provided resize handle.

However, if you disable the editor toolbar via the checkbox in the $:/ControlPanel>Settings>TiddlyWiki tab (or directly set the contents of $:/config/TextEditor/EnableToolbar to “no”), then the tiddler editor textarea is no longer rendered within an iframe, allowing the resize handle to function normally.

-e

oh, interesting to know the technical reasons behind it, and some options.

So disabling the editor toolbar certainly allowed the area to resize the way I’d like, but losing the toolbar means losing the preview toggle (that’s probably about 90% of my toolbar use), and leaving it off is unsatisfying, having it on is worse (the preview honours the height that no longer has a UI to set it, and the editor is Z-Stacked behind the preview!) (and the keyboard shortcut to toggle isn’t available in this mode either)

Knowing it’s an iframe though led me to look into whether iframes can be resizable from the browser end, and in theory, yes! Someone has a live example of it here in 2017(?) Edit fiddle - JSFiddle - Code Playground

However in practice it’s not resizable in firefox (my preference), and Chrome seems to give the resize handle a 1x1 pixel target, which is untenable.

Turns out the modern pure-CSS solution involves a flexbox. My experimenting so far has ended up with this:

/* attempts to make the text editor be resizable - based on https://stackoverflow.com/questions/8117761/how-can-i-make-an-iframe-resizable */
.tc-tiddler-editor {
  display:flex; margin:0; padding:0; resize:both; overflow:hidden;
}
.tc-tiddler-editor > .tc-edit-texteditor {
flex-grow:1; margin:0; padding:0; border:0;
}

…along with TW set to “automatic height”, and gives me the resize pretty close to what I’d want, whilst maintaining the edit bar so I can toggle the preview. It’s imperfect though - the main flaw on this method is that the toolbar is now on the left, in a column alongside the editor rather than along the top, and when the preview is visible, it gets weirder (three columns, and I’ve lost the editor underneat the preview entirely at least once).

It feels like there is a CSS solution possible to have resize + toolbar, though I’m not sure if it’s possible via CSS-only on top of TW5 as it exists, or whether TW’s setting of the size would still have to be disabled entirely?

As I’m not logged in (I assume that’s why?) I just see the Draft of... text but not an editing interface on that link.

However, with a bit more memory prodding, I did remember this (which turns out I’d commented on only a few weeks ago) and may end up using it after a bit more testing

Also found this floating editor toolbar (which I like the look of as a concept)
https://groups.google.com/g/tiddlywiki/c/1oFNPGtQj3c