easydropdown icon indicating copy to clipboard operation
easydropdown copied to clipboard

Unexpected keyboard behavior (in relation to `[ Enter ]` / `[ Return ]`): delay and reset of value

Open apboon opened this issue 5 years ago • 0 comments

Expected behavior (as commonly observed for a drop-down):

  1. When the drop-down component has focus, and I press [ Enter ], a list pops up containing options. If the drop-down has a value, the option matching that value is selected in the list.

  2. If I type the first characters of one of the options in the list, the first option matching those characters is selected. The drop-down will reflect what I have selected in the list.

  3. When I then confirm the selected option by pressing [ Enter ], the list closes. The drop-down still reflecting the option I selected.

  4. When I repeat steps 1 to 3, the behavior is the same every time.

Actual behavior:

Initially, the easydropdown drop-down seem to behave as expected. The drop-down opens when pressing [ Enter ]. And if the drop-down already has a value, it shows in the list of options that pops up.

When I type the first option matching those characters is selected (so far so good).

Problem 1: However, when I press [ Enter ] to confirm the selected option, nothing happens. When I press [ Enter ] a second time, nothing happens. Only after a fixed amount of time (~1000 milliseconds?), the input is finally accepted (maybe the code contains something like setTimeout(function, 1000)?).

Problem 2: But when I don't change the selection in the list, and just confirm the option that is already selected (using [ Enter ]), the value of the drop-down is cleared. So basically, if the drop-down has a value (let's say "Option 3"), pressing [ Enter ] twice will just clear it.

Some background: I am a keyboard-type-of-user, and I noticed the behavior on first try.

apboon avatar Apr 16 '21 14:04 apboon