I read through the Trix documentation and an answer did not jump out at me for this. It appears that the Trix WYSIWYG editor defaults to 3 displayed rows:
Any chance this can be toggled to more rows, for example: 15 or so rows:
I read through the Trix documentation and an answer did not jump out at me for this. It appears that the Trix WYSIWYG editor defaults to 3 displayed rows:
Any chance this can be toggled to more rows, for example: 15 or so rows:
It is a matter of setting the min-height
css attribute. Using javascript, this works if you only have one trix-editor
on the page:
$('trix-editor').css("min-height", "350px");
If you have multiple trix editors on the page and you only want to change the default height for that one: what I did is I wrapped the trix editor in a div, set a class on that div, and used find
:
$('.solution-trix-field-wrapper').find($('trix-editor')).css("min-height", "350px");
Yes, you are right, but I have solved the different way.
You can be overriding the default CSS like trix-content
class
.trix-content{
height: 350px;
}
you can increase the height using this CSS if you want to use scroll after some depth then overflow-y: auto;
like
.trix-content{
height: 350px;
overflow-y: auto;
}
after 350px
it will automatically add the scrollbar.
Try adding it to your stylesheets/application.scss file (if you're using sass - or equivalent files).
In rails 7 I had to override the min-height
of the trix-editor
element. Code in app/assets/stylesheets/actiontext.css
trix-editor {
min-height: 15em;
}