Closed (fixed)
Project:
Panels
Version:
5.x-2.x-dev
Component:
Plugins - contexts
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Jul 2008 at 04:20 UTC
Updated:
15 Jan 2010 at 01:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
triversedesigns commentedI have the same issue with Drupal 5.10, Panels 2 Beta5 and RC1a. Still havent found any solution. Just to not use the enter key
Comment #2
merlinofchaos commentedI believe this is a problem with the autocomplete itself plus the way forms work in HTML.
In general, 'enter' means 'submit the form'. Using the 'enter' key here tries to submit the form. The autocomplete accepts that and it appears to fill in, but the form submit also fires due to the enter key being pressed, and it submits before the autocomplete has a chance to fill in the new value. Thus, you get this error.
I'm not sure there's much that can be done about this since it's using a core piece of javascript that we can't modify.
Comment #3
sunI really don't like to, but I have to prove you wrong here ;)
When doing the same with Drupal's regular autocompletes, f.e. choosing the author on a regular node form, the form does not submit when selecting a value with the keyboard. autocomplete.js implements special event handling for the onKeyUp event in Drupal.jsAC.prototype.onkeyup().
Comment #4
xen commentedI've done a bit of research on this, as I really wanted an autocomplete field in a custom pane content plugin.
"In general, 'enter' means 'submit the form'. Using the 'enter' key here tries to submit the form. The autocomplete accepts that and it appears to fill in, but the form submit also fires due to the enter key being pressed, and it submits before the autocomplete has a chance to fill in the new value. Thus, you get this error."
That's basically correct, with the added twist of panels killing autocomplete.js' submit function. autocomplete.js adds a submit handler to the form containing the field which checks if has an open dropdown and closes it and suppresses normal form submission if it did.
Panels actively unsets all submit handlers on the form when it ajaxifies it, but disabling that code doesn't help, as that just makes both handlers trigger.
Ideally, panels (or perhaps rather the ajaxSubmit in jQuery) should store the submit handlers when attaching, and manually calling them in the submit handler. If any of them return false, it should break out and not submit.
The problem is that getting the original handler(s) is internal jQuery voodoo.
Comment #5
xen commentedThis patch fixes Drupal standard #autocomplete fields. While it's not a 'proper' fix, it'll do as a interim fix until a better solution is found.
Comment #6
sunThis works for modals of the display editor (panels content), but unfortunately not for modals on the context page.
Comment #7
xen commentedsun:
You sure? Does here (tested with 'Add context "Node"').
Comment #8
triversedesigns commentedClosing due inactivity.