When user resizes a textarea the WIDTH and HEIGHT get set in the STYLE attribute

Presumably there is some javascript somewhere listening for some event/s that causes the STYLE to get set?

I would like to listen to the same event/s so that we can set the STYLE for the containing DIV so that the resized textarea does not over or underlap the textareas to the right.

I have asked Sugar Support assuming they would know.

They refused to answer and suggested I ask here.

Does anyone know what javascript causes the STYLE to get set on a TEXTAREA whem the user resizes it?

Sugar Ent 13.0.2

Parents
  • Thanks. I want to allow the user to resize the textarea, in case there is more text entered than can be shown in the default textarea size.

    I took this as inspiration: https://stephanwagner.me/auto-resizing-textarea

    and

    stackoverflow.com/.../resize-event-for-textarea

    I have a custom textarea controller already (custom/clients/base/fields/textarea/textarea.js)

    In _render() I now set the CSS HEIGHT to fit the content (bonus functionality I was not planning!)

    Plus I also set the CSS HEIGHT of the div.record-cell containers to match.This "pushes" the fields to the right so the textarea doesn't sit over or under those fields.

    The record view is for a "table" of data, with multiple "rows" each of multiple "columns".

    It made sense that when the user changes the width of a cell in "column" 1, ALL the containing divs for cells in that "column" change to the same width. This way, the "columns" stay lined up.

    Lukily, the fields were named r0_c0_c to r44_c9_c, so it wasn't too tricky to find the data for the matching "columns"

Reply
  • Thanks. I want to allow the user to resize the textarea, in case there is more text entered than can be shown in the default textarea size.

    I took this as inspiration: https://stephanwagner.me/auto-resizing-textarea

    and

    stackoverflow.com/.../resize-event-for-textarea

    I have a custom textarea controller already (custom/clients/base/fields/textarea/textarea.js)

    In _render() I now set the CSS HEIGHT to fit the content (bonus functionality I was not planning!)

    Plus I also set the CSS HEIGHT of the div.record-cell containers to match.This "pushes" the fields to the right so the textarea doesn't sit over or under those fields.

    The record view is for a "table" of data, with multiple "rows" each of multiple "columns".

    It made sense that when the user changes the width of a cell in "column" 1, ALL the containing divs for cells in that "column" change to the same width. This way, the "columns" stay lined up.

    Lukily, the fields were named r0_c0_c to r44_c9_c, so it wasn't too tricky to find the data for the matching "columns"

Children
No Data