Skip to content

Autocomplete issue with "(" and "&" characters #182

@tamsler-valtech

Description

@tamsler-valtech

Expected Behavior

A user can enter the characters:

  • "(": Open parenthesis
  • "&": Ampersand

Actual Behavior

These keys work as arrow down "(" and arrow up "&". The reason is this:

  • In Ascii, 38 decimal represents ampersand, whereas the keyCode on KeyboardEvents is arrow up
  • In Ascii, 40 decimal represents open parenthesis, whereas the keyCode on KeyboardEvents is arrow down

https://www.ascii-code.com/
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

Reproduce Scenario (including but not limited to)

Using a Swiss German keyboard layout, add an Coral.Autocomplete field with some items and try to enter either "(" or "&" in the text field. If you have a suggestion list, these keys will navigate up and down the list.

The exact line of code responsible for this:

comboListeners = this._keyListeners[event.key.charCodeAt(0)];

This also happens in AEM 6.5.8 and probably all 6.5 versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions