Giter VIP home page Giter VIP logo

core-a11y-keys's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core-a11y-keys's Issues

add support for artificial keydown events from el.fire(...)

right now el.fire('keydown', { keyIdentifier: 'Left'}) won't be picked up by core-a11y-keys because keyboardEventToKey is looking directly on the event object for the key information. It would be great to also be able to simulate key presses without going through the pain of creating native key events and dispatching them (since e.g. the modern KeyboardEvent constructor isn't supported yet in IE, initKeyboardEvent is (was?) buggy in Safari, etc).

AFAICT we could get away with just adding an additional transformKeyIdentifier(ev.detail.keyIdentifier) to the creation of normalizedKey at https://github.com/Polymer/core-a11y-keys/blob/master/core-a11y-keys.html#L226 (or .key, since the comments indicate you prefer it over keyIdentifier). ๐ŸŽ… ๐Ÿ‘

Using "enter" key to submit a value from paper-input does not work

I have this paper-input based statement:

<base-phone-number-input label="{{inputLabel}}" id="PhoneNumber" on-phone-number-validation-error="{{validationError}}" value="{{phoneNumber}}"></base-phone-number-input>

I have this core-a11y-key statement:

<core-a11y-keys target="{{}}" keys="enter tab" on-keys-pressed="{{handleKeypress}}"></core-a11y-keys>

Then following function returns an empty this.phoneNumber even if I input value into the input.

handleKeypress: function(e, detail) {
        console.log("Key pressed: "+detail.key+" phoneNumber: "+this.phoneNumber);
}

Any ideas?

reattaching to target fails

My key-target and paper-input is in a conditional template, like the core-a11-keys listener is too. When displaying the template first everything works nicely. But when hiding and showing the template again, the key-press listener is not working no more.

Code is like this:

<template if="{{ showInput }}">
  <paper-input id="myinput"></paper-input>
  <core-a11y-keys target="{{ $.myinput }}" on-key-pressed="{{ doSomething }}></core-a11y-keys>
</template>

When removing the target the key-event is captured and everything back to normal.

Any ideas? I tried to look at the attach and detach methods of the core-a11y-keys, which seem to work as proposed. The target property contains the right DOM node, but i'm not sure whether it is already attached to the page again or not...

Here is a test case: http://jsbin.com/qemacahatu/1/edit?html,console,output

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.