Opened 7 years ago

Closed 7 years ago

#16142 closed defect (fixed)

dijit.form.textarea max-height

Reported by: gerhard presser Owned by: Douglas Hays
Priority: undecided Milestone: 1.8.2
Component: Dijit - Form Version: 1.7.3
Keywords: Cc:
Blocked By: Blocking:

Description

since dojo 1.7.3 setting the max-height attribute on a dijit.form.textarea doesn't work any more. when the content gets too big, the textarea keeps jumping to the top while typing instead of staying at the cursor positionn.

Attachments (2)

_ExpandingTextAreaMixin.js (4.5 KB) - added by gerhard presser 7 years ago.
_ExpandingTextAreaMixin-1.7.3.js.patch (802 bytes) - added by gerhard presser 7 years ago.
patch-file based on dojo 1.7.3

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by gerhard presser

Attachment: _ExpandingTextAreaMixin.js added

Changed 7 years ago by gerhard presser

patch-file based on dojo 1.7.3

comment:1 Changed 7 years ago by Douglas Hays

Owner: changed from Douglas Hays to gerhard presser
Status: newpending

I don't see the problem. Also, Textarea no longer uses maxHeight so I'm not sure how that factors into the problem. If possible, please describe the recreate steps and the browser version using the latest 1.7.4 test page:
http://download.dojotoolkit.org/release-1.7.4/dojo-release-1.7.4/dijit/tests/form/test_Textarea.html

comment:2 Changed 7 years ago by gerhard presser

Status: pendingnew

I want to use the textarea with max-height set to 200px. the scrollbar appears if it gets too large, but it keeps scrolling to the top.

<textarea data-dojo-type="dijit.form.Textarea" style="max-height:200px"></textarea>

comment:3 Changed 7 years ago by Douglas Hays

I wasn't expecting people to set max-height on an auto-expanding textarea. Why didn't you want to use SimpleTextarea with max-height set?

comment:4 in reply to:  3 Changed 7 years ago by gerhard presser

Replying to doughays:

I wasn't expecting people to set max-height on an auto-expanding textarea. Why didn't you want to use SimpleTextarea with max-height set?

I want to use the benefits of both worlds - the textarea stays small with no/little content - and should be able to expand to a certain size - if it exeeds a max-height, the content should start to scroll.

comment:5 Changed 7 years ago by Douglas Hays

Milestone: tbd1.8.2
Owner: changed from gerhard presser to Douglas Hays
Status: newassigned

comment:6 Changed 7 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

In [29858]:

Fixes #16129, #16142. Watch resize events on TEXTAREA elements for changes. Fixup scrollTop in case max-height is being set by user. Add automated tests.

Note: See TracTickets for help on using tickets.