Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforeInsert insert functional keys as text on firefox #549

Closed
Vick-edit opened this issue Apr 14, 2017 · 2 comments
Closed

beforeInsert insert functional keys as text on firefox #549

Vick-edit opened this issue Apr 14, 2017 · 2 comments

Comments

@Vick-edit
Copy link
Contributor

Vick-edit commented Apr 14, 2017

С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)

@Vick-edit Vick-edit changed the title beforeInsert insert service keys as text beforeInsert insert functional keys as text on firefox Apr 17, 2017
Vick-edit added a commit to Vick-edit/Keyboard that referenced this issue Apr 17, 2017
Vick-edit added a commit to Vick-edit/Keyboard that referenced this issue Apr 17, 2017
Vick-edit added a commit to Vick-edit/Keyboard that referenced this issue Apr 17, 2017
Vick-edit added a commit to Vick-edit/Keyboard that referenced this issue Apr 17, 2017
@Mottie
Copy link
Owner

Mottie commented Apr 17, 2017

Hi @Vick-edit!

Sorry for not responding earlier... I had lots of distractions over this weekend.

I'll take a look at this and the PR in more depth later today.

Vick-edit added a commit to Vick-edit/Keyboard that referenced this issue Apr 17, 2017
Vick-edit added a commit to Vick-edit/Keyboard that referenced this issue Apr 17, 2017
@Mottie
Copy link
Owner

Mottie commented Jun 3, 2017

Thanks again, version 1.26.23 is now available.

@Mottie Mottie closed this as completed Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants