Opened 9 years ago
Closed 8 years ago
#13166 closed defect (fixed)
[patch][ccla]dijit.form.ExpandingTextAreaMixin.resize might compute negative height throwing error under IE
Reported by: | Patrick Ruzand | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit - Form | Version: | |
Keywords: | Cc: | pruzand@… | |
Blocked By: | Blocking: |
Description
The issue is specific to IE, and happens when the TextArea? resize() is triggered. In some situation, the height value that is assigned to "textarea.style.height" can be negative, throwing an "invalid argument" error :
in dijit/form/_ExpandingTextAreaMixin.js, l.89 :
var currentHeight = textarea.style.height; if(!(/px/.test(currentHeight))){ [...] } var newH = parseInt(currentHeight) + textareaScrollHeight() -
textarea.clientHeight;
var newHpx = newH + "px"; if(newHpx != textarea.style.height){
textarea.rows = 1; textarea.style.height = newHpx; <<<<<<< error if newHpx is < 0
}
In my use case, the computed newH value is < 0, which gives the exception. I would say 'newH' should be checked against negative value.
Attachments (2)
Change History (5)
Changed 9 years ago by
Attachment: | 13166.patch added |
---|
comment:1 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
While this prevents an exception, it does 2 bad things:
1) hides the fact that the web page needs to change to SimpleTextarea? since Textarea "owns" height
2) causes the textarea to be chopped off and scrollbars to appear
comment:2 Changed 9 years ago by
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Setting minHeight in IE8 is also causing an exception
comment:3 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
testcase + patch