Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind ui-sref to DOM events other than click #3169

Closed
Thrilleratplay opened this issue Nov 23, 2016 · 3 comments
Closed

Bind ui-sref to DOM events other than click #3169

Thrilleratplay opened this issue Nov 23, 2016 · 3 comments

Comments

@Thrilleratplay
Copy link

There are occasions when ui-sref will not work as intended as when bound to the click event. A common example is when a navigation menu that will hide when the blur event is triggered. Blur is triggered before click so a ui-sref link will do nothing. The work around is to execute $state.go on mousedown. Other times, I want to highlight on a single click and go to a state on doubleclick.

Could there be an option to override the default binding where mousedown and dblClick are possible triggers for ui-sref?

@christopherthielen
Copy link
Contributor

hmm, interesting idea. I think your argument is sound.

I would accept a PR which adds this capability using ui-sref-opts="{ event: ['click', 'mousedown'] }"

@gcca
Copy link
Contributor

gcca commented Feb 1, 2017

Currently I am working on this feature for legacy version in gcca@c355119
@christopherthielen, are you consider this feature to UI-Router for Angular 2?

@christopherthielen
Copy link
Contributor

@gcca if you make a PR for ng1 or ng2 I'll review and merge it.

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

No branches or pull requests

3 participants