Textbox quirk with 3.69
2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 23, 2024 (RSS)
By JeffC - May 20, 2024
Hi Dave
When a line of text exceeds the width of the box it stays on one line and adds a horizontal scroll bar. With previous versions the text would wrap onto the next line. Is this by design? Is there anything I can do to change it back?
I thought it may be a browser issue. I've tried in Safari 17.2.1 and Chrome 124.0.6367.209 (both Mac) and they have the same issue.
Thanks
Jeff
By Dave - May 23, 2024
Hi Jeff,
Thanks for reporting this, it's a bug in the current version and is fixed in the next beta & release.
Here's a patch. In /lib/fields/TextBox.php replace this
$return = <<<__HTML__
{$this->getPrefix()}
<textarea name='$this->name' class='form-control setAttr-wrap-off' style='$style' id='$this->name' rows='5' cols='50'>$encodedValue</textarea>
{$this->getDescription()}
__HTML__;
with this:
$useCodeEditor = !empty($this->fieldSchema['useCodeEditor']);
$textareaClass = $useCodeEditor ? "form-control setAttr-wrap-off" : "form-control";
$return = <<<__HTML__
{$this->getPrefix()}
<textarea name='$this->name' class='$textareaClass' style='$style' id='$this->name' rows='5' cols='50'>$encodedValue</textarea>
{$this->getDescription()}
__HTML__;
Or just remove "setAttr-wrap-off" if you're not using the new textbox option to display as a code editor.
Let me know if that works for you.
interactivetools.com