Opened 13 years ago

Closed 13 years ago

Last modified 9 years ago

#5551 closed defect (fixed)

dijit.textarea fires onchange when loaded empty

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: textarea onchange Cc:
Blocked By: Blocking:


Seems like there is a bug in the onChange trigger. When I set a onChange event publish with dojo/method it works fine when the textarea contains some text initially, but if it is empty it triggers the onchange event when the form is loaded. That can not be correct? I have tried with intermediateChanges="false" but it does not help. This triggers onchange: <code> <textarea intermediateChanges="false" dojoType="dijit.form.Textarea" class="textInput" name="keywords" id="captions_keywords"></textarea> </code> This does not (note the underscore 'value') : <code> <textarea intermediateChanges="false" dojoType="dijit.form.Textarea" class="textInput" name="keywords" id="captions_keywords">_</textarea> </code>

This might not be happening always, but in a form global onchange and inside an accordionwidget it does.

I have found a working solution: dojo.trim on line 73, like this: this.value = this.formValueNode.value = dojo.trim(value);

Change History (4)

comment:1 Changed 13 years ago by bill

Cc: Douglas Hays removed
Owner: set to Douglas Hays

comment:2 Changed 13 years ago by Douglas Hays

Status: newassigned

comment:3 Changed 13 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [11994]) Fixes #5551. Setting designMode=on was adding a <BR> tag to innerHTML so I went ahead and added this initially to keep the onChange from firing. Removed bottom padding from IE to remove the extra sace at the bottom. Removed empty text nodes. Changed IE line-height of inserted <p> tags to avoid rendering problems. Disabled textareas where still being submitted. Mirrored the disabled atribute in the hidden field.

comment:4 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.