• Welcome to Simple Machines Community Forum. Please login or sign up.

SMF 2.1 RC4: Hard-coded height restriction on SCE Editor textarea.

Started by Antechinus, August 30, 2021, 08:43:14 PM

Previous topic - Next topic


This one is a pain in the posterior when checking formatting for longish posts. Can it be removed, to allow unlimited height? Or, at the very least, doubled from what it is now?

Would be a big usability improvement, for stuff all code changes. Should not even require anything much in the way of testing. Kthnx. :)

ETA: .sceditor-container seems to be restricted to 370px max-height, being applied by javascript as an inline style, but at the moment I haven't found where that is coming from.

Diego Andrés

That is "hardcoded" in the sceditor file, the main main one  :laugh:

maxHeight = options.resizeMaxHeight || origHeight * 2.5;https://github.com/samclarke/SCEditor/blob/042ddbded861e7ddad895ab78c1557aaf242278a/src/lib/SCEditor.js#L843

@live627 would need to take a look at it maybe, or comment on this

SMF Tricks - Free & Premium Responsive Themes for SMF.


Aha. Ok cool. I tried overriding it with CSS in Stylus (even used !important) but it refuses to be overridden. :P

Although I just ran a search on the whole 2.1 directory on my test site, and that code doesn't turn up anywhere. So presumably something else in 2.1 is doing the same job somewhere.

Diego Andrés

It's because once the sceditor files are compiled and minified, this ends up somewhere in jquery.sceditor.bbcode.min.js, could probably remove it deleting this from your file
This is just a hack, obviously live627 would need to check for that on the main files, if he wants  :P

SMF Tricks - Free & Premium Responsive Themes for SMF.


Ok thanks. I'll try that on a test site and see what it destroys. Although I'd be inclined to just double it from 2.5 to 5, just in case completely removing it throws it for a loop. Changing an integer or two shouldn't upset it.


Fairly sure each instance of the editor being configured (via control_create_richedit or whatever it's called) sets the height. It certainly used to set the default height and I have instances of much bigger ones.

Though it does have an annoying "you can't resize it more than a certain size from what it started as" by default which is I think what is being outlined above.
No good deed goes unpunished
All helpful urges should be circumvented