Comment 2 for bug 1384547

Revision history for this message
Robert Lyon (robertl-9) wrote :

Problem is before this patch -> https://reviews.mahara.org/#/c/3839/ some textarea, when hidden on page load, (as well as their parent elements) was returning a div container with style 0px by 1px due to the textarea not having width/height when display = none.

The patch fixed that but broke this - due to the fact that if you set a textarea pieform element with width attribute it sets the cols attribute as 1/10 of the width value - even if you specify cols as well. So that textarea is suppose to be 50 cols wide but ends up being generated as 10 cos wide.

However, saying that, what would be better is if the js can detect if the textarea's parent is visible on page load and then find out the width of the parent and use that to calculate the textarea width if the textarea has it's width set to 100% and only fallback to the cloning of the textarea and appending it to body element if both textarea and it's parent are display = none