Skip to content

beforeInsert insert functional keys as text on firefox #549

Description

@Vick-edit

Сonfiguration:

  1. Jquery - 1.12.4
  2. jquery.keyboard - 1.26.19
  3. browser - firefox 52.0.2 (x86)

Action:

  1. Add handling for beforeInsert event, that just return textToAdd
  2. Start typing from physical keyboard then use arrow keys or F1 and etc.

Result:
Instead navigation by text we get symbols inserted in text.

Example:
http://jsfiddle.net/VikEdit/z3jtn6wy/

Cause
Before calling
jquery.keyboard.js#L806

base.insertText(base.last.key);
e.preventDefault();

We need analyze is it text, number key or functional key by e.keyCode or e.key.length, cause firefox raise keypress event for functional keys too.

I figured out, that when firefox raise keypress event for functional keys it put incorrect data in which and charCode (charCode alwayse is zero and which zero or keyCode from table more often zero)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions