How to control height of edit-text widget?

51 views
Skip to first unread message

Mark S.

unread,
Jan 5, 2021, 1:18:28 PM1/5/21
to TiddlyWiki
When I create an edit-text widget with tags="textarea", rows=1, autoHeight="no", instead of doing nothing, the widget generates a style with height=400px.  Since this is a style, not a class, I have no hope of overwriting this behaviour with a class. And apparently the height even takes precedence over rows="1". 

What I want is a textarea box that looks like an input area, and doesn't expand vertically even if the input text is many lines long. I need it to be a textarea box because an input won't retain linefeeds.

Thanks!

Saq Imtiaz

unread,
Jan 5, 2021, 2:31:45 PM1/5/21
to TiddlyWiki
I've struggled with this before. A few things that help IIRC:

set minHeight to 1em

Add a class that sets:
width: 100%;
resize: none;
white-space: nowrap;
overflow-x: scroll

I think that gets you close but not quite there.

Saq Imtiaz

unread,
Jan 5, 2021, 2:35:41 PM1/5/21
to TiddlyWiki
Also setting the height via a class but with !important should override the inline styles.

Note sure how any of this will respond to line-breaks though.

Mark S.

unread,
Jan 5, 2021, 4:13:00 PM1/5/21
to TiddlyWiki
The !important was ... important. I didn't realize it was possible to override styles set in the style attribute.

Thanks!

Reply all
Reply to author
Forward
0 new messages