Opened 11 years ago

Closed 10 years ago

#8087 closed defect (fixed)

InlineEditBox: autosave with a textarea widget doesn't work

Reported by: Dustin Machi Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit Version: 1.2.1
Keywords: Cc:
Blocked By: Blocking:

Description

When you use a textarea widget with the inline editor it never receives an enter event because the textarea widget is stopping that event for an unknown reason. In local patches everything is good if you remove that stop event (in the keyboard handler).

I spoke to doughays about this a couple weeks ago and he indicated that it works for him. I have no idea why or how that could be the case. A modified version of the existing test case is available here:

http://dmachi.dojotoolkit.org/dojotoolkit/dijit/tests/test_InlineEditBox.html

Go to this page, click on the line "We sincerely appreciate your business". This will become a textarea, and then you can type in it. This all works but when you hit enter it just creates a new line...this makes sense in many cases since it is a multi line area. But it isn't up to the widget to decide whether other thigns can attach to its keypress and watch for the enter key. This prevents the widget from workign with autosave on the Inline Editor

Here is a one line patch: Index: form/Textarea.js =================================================================== --- form/Textarea.js (revision 15523) +++ form/Textarea.js (working copy) @@ -243,7 +243,7 @@

this.iframe.focus(); this.focus(); won't work dojo.stopEvent(e);

}else if(e.charOrCode == dojo.keys.ENTER){

  • e.stopPropagation();

+ e.stopPropagation();

}else if(this.inherited("_onKeyPress", arguments) && this.iframe){

#3752: The key press will not make it past the iframe.

Attachments (1)

8087.patch (1011 bytes) - added by Douglas Hays 11 years ago.
Possible fix. dmachi, can you verify?

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 years ago by bill

Owner: set to Douglas Hays
Summary: Autosave with a textarea widget doesn't workInlineEditBox: autosave with a textarea widget doesn't work

Hmm, I'm not sure why that code is there in Textarea, although it might have something to do with FF2 iframe support?

In any case InlineEditBox only monitors ENTER key when autoSave=false so I don't think that code needs to be there on behalf of InlineEditBox.

comment:2 Changed 11 years ago by Dustin Machi

I think you have this backwards. It is only when autoSave=true that the enter key is watched by InlineEditBox?. When autoSave==false, then it shows the cancel/save buttons. I can't figure out why it would ever stop the event, though I suppose it could be something like ff2 iframe support.

comment:3 Changed 11 years ago by Douglas Hays

References #3752 [9898]

Changed 11 years ago by Douglas Hays

Attachment: 8087.patch added

Possible fix. dmachi, can you verify?

comment:4 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

[15822] Fixes #8087. Remove ENTER key intercept in Textarea and only autosave on ENTER for INPUT widgets.

Note: See TracTickets for help on using tickets.