iron-test-helpers icon indicating copy to clipboard operation
iron-test-helpers copied to clipboard

Allow a MockInteractions.pressAndReleaseKeyOn alternative that takes a keyIdentifier

Open andybons opened this issue 10 years ago • 0 comments

MockInteractions.pressAndReleaseKeyOn(element, 221); // ']'

Will fail because the custom event doesn’t have a keyIdentifier and the keyCode lies outside of what is present in KEY_CODE within https://github.com/PolymerElements/iron-a11y-keys-behavior/blob/master/iron-a11y-keys-behavior.html

A workaround for now has been to create my own function pressAndReleaseKeyIdenfitifierOn(element, '\U+005D') which sets the keyIdentifier which is then recognized by iron-a11y-keys-behavior via transformKeyIdentifier.

andybons avatar Dec 01 '15 05:12 andybons