I found that having either the file or image widgets attached to a content type prevent the enter key from working in textareas on the node form. I verified this with the latest HEAD in FF3, IE8, Safari, Opera, and Chrome.

I'm not sure what's causing it yet. Anyone also have this issue?

CommentFileSizeAuthor
#3 enterkey.patch1.15 KBcarlos8f

Comments

carlos8f’s picture

Title: Enter key disabled by ajax.js, making it impossible to use textareas properly » Enter key doesn't work in node form textareas when file widget is on a content type
carlos8f’s picture

Title: Enter key doesn't work in node form textareas when file widget is on a content type » Enter key disabled by ajax.js, making it impossible to use textareas properly

I found #212423: Standardize form submission behavior when "enter" key is pressed, in which this bug is mentioned. I like @David_Rothstein's initiative, but preventing accidental submission is minor compared to a bug preventing multi-line content from being created.

The code that disables the enter key is described in http://drupal.org/node/212423#comment-2128568.

To replicate, install 7.x-dev and go to node/add/article; you won't be able to make any line breaks in the node body. Disabling the file/image modules or commenting out the "return false" on ajax.js line 177 makes the enter key work again. I don't know enough about the Drupal.ajax method to recommend a fix yet.

carlos8f’s picture

Title: Enter key doesn't work in node form textareas when file widget is on a content type » Enter key disabled by ajax.js, making it impossible to use textareas properly
StatusFileSize
new1.15 KB

Here's a "quick and dirty" fix for this. It keeps track of the page focus and disables Drupal.ajax's keypress trigger if a textarea is in focus.

carlos8f’s picture

Status: Active » Closed (duplicate)