Enterprise: Enter key opens dropdown list, when it should only be used to select items within an open list

Created on 19 Nov 2018  路  8Comments  路  Source: infor-design/enterprise

According to the documentation, the following key behaviours apply to drop-down lists...

image

...so pressing space or down arrow is documented as opening the list dropdown (so is alt+down arrow but doesn't work in FireFox/Google), but pressing the Enter key also opens the list, and this causes a big problem for us as out applications use enter as input/advance, so if the user has focus on a drop-down they cannot advance to the next screen without moving to a non-list field.

Previously, in 4.4 version, I was able to override this behaviour by putting an addtional key-down event on the "pseudoElem", but now it seems that there is another key event firing before this so the list is already open.

Ideally, the drop-down should conform to the documented behaviour, but if that is not possible, I need to be able to intercept the very first key-down event and block it before the "list open" event is fired (FYI - tried using the onKeyDown option and that only appears to be called when the list is already open) , so any recommended example of doing that would be useful.

[2] high type

Most helpful comment

@ericangeles - For that case you could just update the example so the enter key works if the list is open. Fx..

if ('#dropdown-list').is(':visible')) {
   return;
}

All 8 comments

I think your right, enter should only work when the list is open or you cant submit the form. We should be following these guidelines https://www.w3.org/TR/wai-aria-practices-1.1/#combobox and as noted in the docs. i also tested the onKeyDown and it is in fact only working when open.

Changes

  • Make onKeyDown work when closed and make an example of overriding the enter key, lets leave the enter key as its a big vague. Add an example of skipping enter when closed. Will leave enter as is as its been like this for a long time.
  • fix alt+down arrow

@ericangeles make sure to test https://github.com/infor-design/enterprise/issues/1262 as well but i think thats a dup, just give it a test and we should be good on that too.

For my use case in #1262 it was originally fixed in https://github.com/infor-design/enterprise/pull/128 (as part of SOHO-4815) but has regressed since then.

@ericangeles when your feeling better can you start this one next as the LSF team would like to patch this soon for their release. Can just do it as normal on master and they can merge it when its reviewed and fixed.

http://localhost:4000/components/dropdown/test-allow-custom-keystroke.html
Moving to failed QA. Enter key doesn't work when the list is open.

@ericangeles - For that case you could just update the example so the enter key works if the list is open. Fx..

if ('#dropdown-list').is(':visible')) {
   return;
}

QA BDD Test Script Attached:
story_github#1239.docx

Was this page helpful?
0 / 5 - 0 ratings