Skip to main content
Topic: sceditor as configured does not use editor_settings['height'] (Read 1818 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

sceditor as configured does not use editor_settings['height']

Turns out setting height:100% on sceditor does not actually make sceditor match the height of the existing textarea, so changing the editor height in $context doesn't do anything.

If you simply delete the height line from sceditor in GenericControls it does use the height of the existing text area.  Although it turns out that height includes the toolbar and grip, but I don't think that's anything new.

Pull request here.
https://github.com/elkarte/Elkarte/pull/1536

Re: sceditor as configured does not use editor_settings['height']

Reply #1

Yeah, I suspect the 100% was a remnant from the period when I was trying to make it expand "forever".
IIRC, removing it should be safe, so merged.
Remember if it breaks something: blame Norv. :P
Bugs creator.
Features destroyer.
Template killer.

Re: sceditor as configured does not use editor_settings['height']

Reply #2

One thing I did note with this change is it makes the mobile editor smaller as the header takes more space on mobile.  I boosted the height if your mobile browser flags were set.  I noticed when poking at the code there were variables about not subtracting the header from the height of the edit box.  It might only set those if you supply a separate container to hold the toolbar but it might be worth considering so we don't have this odd textarea size shrinks based on browser width.

Odd bug too that doesn't matter with the height:100% dropped, but when I had height:100% and set the border of the sceditor container to none it got very confused and made the textarea like 1 line high.

 

Re: sceditor as configured does not use editor_settings['height']

Reply #3

Looks like an interesting thing to try indeed.
Bugs creator.
Features destroyer.
Template killer.