I wanted to report an issue that has become a rather tricky usability/training item where we're using CKeditor Link--The autocomplete for CKeditor Link that pops up in the CKeditor dialog does not conform to the same set of expected behaviors as other drupal autocomplete fields.

If a user attempts to use the keyboard to highlight a choice in the autocomplete dropdown, the hightlight box moves as expected...
When the user hits enter/return to choose a selection--expected: the selected item is populated, actual: the users stub of text is submitted as-is by the dialog.

We did discover after some time that the 'tab' key also autocompletes, but it is not very obvious to users. Also, other Drupal autocomplete fields (such as term reference) accept an enter/return keypress without attempting to submit the form.

I'm guessing this behavior could be modified somewhere in the dialog JS. If enter/return behavior is not feasible, perhaps help text about the 'tab' key would be appropriate

Comments

erykmynn’s picture

Version: 7.x-2.3 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new542 bytes

I have gotten to the bottom of this. Drupal.autocompleteSubmit() method exists to prevent this behavior. I added a call to this to the validate definition of the extended dialog and it now works as expected. Seems like a straightforward change, implementing the autocomplete API more fully. Only affects the validation if the autocomplete is open on "submit".

anrikun’s picture

Status: Needs review » Closed (duplicate)

This looks like a duplicate of #1991076: Select link from autocomplete list using keyboard arrows and return fails in firefox and chrome that should be fixed in dev.
Please try 7.x-2.x-dev and confirm that it works.

erykmynn’s picture

My bad. I swear I searched up and down for a corresponding issue. I'll add my $.02 to the other issue since my version of the fix addresses some of the concerns there, thanks.