Coder Social home page Coder Social logo

Comments (6)

web-padawan avatar web-padawan commented on August 28, 2024

I'm going to send a PR to fix that warning.
Shouldn't we get rid of the keyIdentifier at all?
/cc @valdrinkoshi

from iron-a11y-keys-behavior.

valdrinkoshi avatar valdrinkoshi commented on August 28, 2024

I'm afraid it would be a breaking change as other browsers don't support key yet, and the other options (keyCode, charCode) are no better than keyIdentifier...

from iron-a11y-keys-behavior.

samccone avatar samccone commented on August 28, 2024

@valdrinkoshi thoughts on falling back to key Identifier if key is not supported?

from iron-a11y-keys-behavior.

valdrinkoshi avatar valdrinkoshi commented on August 28, 2024

@samccone that's already happening, see https://github.com/PolymerElements/iron-a11y-keys-behavior/blob/master/iron-a11y-keys-behavior.html#L178

Fall back from .key, to .keyIdentifier, to .keyCode, and then to .detail.key to support artificial keyboard events

from iron-a11y-keys-behavior.

samccone avatar samccone commented on August 28, 2024

correct, but switching the order of the fallback so that .keyIdentifier is lower on the || fall through.
Testing a patch locally now.

from iron-a11y-keys-behavior.

valdrinkoshi avatar valdrinkoshi commented on August 28, 2024

Unfortunately the warning gets displayed anyways if for example you hit "?" (shift + / key in US keyboard). I think that normalizedKeyForEvent should be converted to something like:

if (keyEvent.key) {
  return transformKey(keyEvent.key, noSpecialChars);
}
if (keyEvent.detail && keyEvent.detail.key) {
  return transformKey(keyEvent.detail.key, noSpecialChars);
}
return transformKeyIdentifier(keyEvent.keyIdentifier) ||
  transformKeyCode(keyEvent.keyCode) || '';

I'll take care of that (there are some tests to be fixed)

from iron-a11y-keys-behavior.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.