Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Keyboard Button Interaction Bug #991

Closed
SimeonC opened this issue Dec 19, 2014 · 4 comments
Closed

Keyboard Button Interaction Bug #991

SimeonC opened this issue Dec 19, 2014 · 4 comments
Assignees
Milestone

Comments

@SimeonC
Copy link

SimeonC commented Dec 19, 2014

I found an odd bug to do with the mdButton directive and keyboard interaction.

Example here: http://plnkr.co/edit/6QhhohD5fwYtIkb8GDT3?p=preview

Steps:

  1. Click into input.
  2. Tab to normal button.
  3. Press Enter/Spacebar - count increments by 2!
  4. Tab to md-button
  5. Press Enter/Spacebar - count decrements by 2!
  6. Comment out the angular-material.min.js script and the DI in the module definition.
  7. Repeat steps 1 - 3 - count increments by 1!!!
@marcysutton
Copy link
Contributor

That is weird! I actually think it might be related to ngAria, which ngMaterial pulls in as a dependency. There is a bug in ngClick where it fires both click and keypress on native buttons and probably anchors, causing the callback to be run more than once. That could definitely cause problems like this! angular/angular.js#10388

@marcysutton
Copy link
Contributor

This is still dependent on angular/angular.js#10388.

@marcysutton marcysutton modified the milestones: 0.9.0, 0.8.0-rc1 Feb 6, 2015
@marcysutton
Copy link
Contributor

@SimeonC the fix for ngAria has been merged to Angular.js master and should go out in the 1.4 release, so I'm going to close this issue. I forked your Plunker to use angular-aria version 1.3.5 (the last version without the bug), and it appears to work fine. So I'm pretty sure the 1.4 release will solve your issue. http://plnkr.co/edit/x5T3fM6xj0JWlKXYPhdv?p=preview

@SimeonC
Copy link
Author

SimeonC commented Feb 9, 2015

Cool beans! Thanks for letting me know. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants