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

md-button with ng-click - Behavior when invoked from keyboard #1326

Closed
braintapper opened this issue Jan 28, 2015 · 5 comments
Closed

md-button with ng-click - Behavior when invoked from keyboard #1326

braintapper opened this issue Jan 28, 2015 · 5 comments
Assignees

Comments

@braintapper
Copy link

http://plnkr.co/edit/aNsDEC4BH42x9uay8ICJ?p=preview

Experiencing some strange behavior when using the keyboard to fire an md-button with an ng-click event. I only tested in Windows.

In Chrome/Windows
If you use the keyboard to tab to the button and hit the space bar to press the button, the ng-click event fires twice.

In Firefox/Windows
If you use the keyboard to tab to the button and hit the space bar to press the button, nothing happens (expected?). If you hit Return, nothing happens. But if you click the button after hitting Return, the ng-click event fires for every time you hit Return as though the event was being queued up.

In Internet Explorer/Windows
Similar to firefox, if you hit space, you see the button press but nothing happens until you click the button. Any previous button presses using the space bar appear.

@marcysutton marcysutton self-assigned this Jan 28, 2015
@marcysutton
Copy link
Contributor

Multiple click events fired on native buttons are due to a known issue related to ngAria: angular/angular.js#10766 We're hoping to get the bugfix resolved next week to get in to the Angular 1.4 release.

That is super weird about Firefox. I can repro it on a Mac. Legit issue.

@marcysutton
Copy link
Contributor

Firefox issue fixed with 79196c3. ngAria bug is tracked in #991.

@jarrodpayne
Copy link
Contributor

@marcysutton Is there a workaround you can suggest in the meantime? We've got a demo coming up soon for a product, and I'm blanking on how to fix this cleanly.

@marcysutton
Copy link
Contributor

@jpdesigndev for the ngAria bug I've been using an older version of angular-aria. The bug was introduced in Angular 1.3.6. In your HTML, you can reference the previous version, 1.3.5. Here is a Codepen I created to track it and test fixes:

http://codepen.io/marcysutton/pen/YPxrLd

@jarrodpayne
Copy link
Contributor

Awesome. Thanks for the help!

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

No branches or pull requests

3 participants