forms: reduce empty & readonly textareas to a single row (#26538)
This commit is contained in:
parent
3af73aeb21
commit
7f5a866bfb
|
@ -174,6 +174,8 @@ def text_render_content(self):
|
|||
attrs['cols'] = 72
|
||||
if not attrs.get('rows'):
|
||||
attrs['rows'] = 5
|
||||
if attrs.get('readonly') and not self.value:
|
||||
attrs['rows'] = 1
|
||||
return (htmltag("textarea", name=self.name, **attrs) +
|
||||
htmlescape(self.value or "") + htmltext("</textarea>"))
|
||||
TextWidget.render_content = text_render_content
|
||||
|
|
Loading…
Reference in New Issue