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

fix(ngAria): trigger digest on ng-click via keypress, pass $event to expression #10443

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Dec 12, 2014

Minor improvement to ng-click directive from ngAria. Now, if bindings are updated
during the click handler, the DOM will be updated as well. Additionally, the $event
object is passed in to the expression via locals, as is done for core event directives.

Closes #10442

@googlebot
Copy link

CLAs look good, thanks!

@caitp
Copy link
Contributor Author

caitp commented Dec 12, 2014

This does not fix the ngDblClick issue, that seems harder to emulate via keypress :< @gkalpak / @marcysutton could you review?

@marcysutton
Copy link
Contributor

I'm unable to review until Tuesday. But I'll dive in then if it's still unresolved!

On Dec 12, 2014, at 2:25 PM, Caitlin Potter notifications@github.com wrote:

This does not fix the ngDblClick issue, that seems harder to emulate via keypress :< @gkalpak / @marcysutton could you review?


Reply to this email directly or view it on GitHub.

compile: function(elem, attr) {
var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true);
return function(scope, elem) {
if ($aria.config('tabindex') && !elem.attr('tabindex')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be safe to move this into compile ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There would be a problem with replace: true directives, which has been reported for other places where we do this, like ngModel. It's a trade-off, perf vs correctness

@gkalpak
Copy link
Member

gkalpak commented Dec 12, 2014

Other than a couple of minor comments, it LGTM.

👍 at BrowserStack

…expression

Minor improvement to ng-click directive from ngAria. Now, if bindings are updated
during the click handler, the DOM will be updated as well. Additionally, the $event
object is passed in to the expression via locals, as is done for core event directives.

Closes angular#10442
Closes angular#10443
Closes angular#10447
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(ngAria): ng-click evals attrs.ngClick without passing locals
4 participants