In panels you are able to add a node to layout column. If you have 4 nodes with a title named "Example 1", "Example 2", "Example 3" and "Example 4" any you type in the autocomplete fields "Ex" the four node titles are shown in the dropdown. Moving the cursor to "Example 3" and pressing enter causes the item to get selected first and the [nid: 3] shown for a few seconds in the 'Enter the title or NID of a node' field, but then the auto-save comes in action and the selection is lost.
Selecting an node with this bug is nearly impossible... it was a challenge to figure out the nid in the 2 seconds after item selection and then write "[nid: 3]" in the autocomplete + saving than - only to add a node to a column.
I think I've found the form item that have this issues:
$form['nid'] = array(
'#prefix' => '<div class="no-float">',
'#title' => t('Enter the title or NID of a node'),
'#description' => t('To use a NID from the URL, you may use %0, %1, ..., %N to get URL arguments. Or use @0, @1, @2, ..., @N to use arguments passed into the panel.'),
'#type' => 'textfield',
'#maxlength' => 512,
'#autocomplete_path' => 'ctools/autocomplete/node',
'#weight' => -10,
'#suffix' => '</div>',
);
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | fix-autocomplete-581670.patch | 612 bytes | mariacha1 |
| #10 | bad-autosubmit-keypress.png | 49.04 KB | mariacha1 |
| #10 | good-autosubmit-keypress.png | 49.83 KB | mariacha1 |
| #4 | fix-autocomplete.patch | 1.31 KB | merlinofchaos |
| #2 | fix-autocomplete.patch | 1.1 KB | merlinofchaos |
Comments
Comment #1
hass commentedNot sure if this is "auto-save"
Comment #2
merlinofchaos commentedDoes this fix it for you?
Comment #3
hass commentedYes, it prevents the lost item selection, but shows the status-active.gif next to the submit button without any action (DIV with class "ctools-ajaxing"). Pressing the submit button adds an additional status-active.gif until the modal window closes.
Comment #4
merlinofchaos commentedHm. Try this one instead.
Comment #5
hass commentedTested, and works well. THX
Comment #6
merlinofchaos commentedChecked in!
Comment #8
nagiek commentedHi, sorry to open this up again, but it seems it was lost somewhere along the way.
Same fix applies, but needs to be placed in modalEventHandler.
Will contribute a patch.
Comment #9
fourmi4x commentedHi, thanks a lot nagiek, your fix works great on drupal 6 too.
Comment #10
mariacha1 commentedI'm attempting a patch to take care of this for 7.x-1.x-dev (at e81da7a).
Here's a couple images trying to explain the situation for refreshing people's memory:
Currently typing a few letters into the autocomplete, hitting the down arrow button to select your desired node, then hitting "Enter" ALSO submits the form with the junk few letters you typed.

So the patch requires you to hit "Enter" again to submit the form itself. This is the default behavior of Drupal's autosubmit:

Comment #11
dsnopekThis problem is still present in CTools 1.4 and this patch still fixes it! (It applies with some fuzz - offset 9 lines)
This is also an accessibility problem: it makes it difficult to use the autocomplete via the keyboard (although, it's still possible by using the TAB key rather than ENTER - but how is anyone to know that?).
We're going to start using this patch in Panopoly soon because of the accessibility impact.
Comment #13
japerryLong standing annoyance that is reproducible. Patch works for me as well, soo... Fixed!