-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Need event.preventDefault in tab click event #842
Comments
(click)="removeTab(tabz); return false;" |
I was referring to the ng2-bootstrap code in the tabset.component.ts template, not my code.
Where on remove it does $event.preventDefault(); for you but for regular clicks it doesn't. Shouldn't it? At the time I think I was trying to get it working using $event.preventDefault(); in my click handler but that didn't work. Returning false from a handler seems to. |
@slubowsky oh, I know where the issue could be |
fixes valor-software#766, fixes valor-software#842 * chore(package): update typescript to version 2.0.3 https://greenkeeper.io/ * Add customClass property to the Tab directive to make it easy to add class names to the outputted nav-items * tslint fix * Clicking on some tabs would sometime result in reloading the application (tested in Chrome). This will probably fix issue valor-software#842 which sounds exactly like the scenario this fixes for me.
fixes valor-software#766, fixes valor-software#842 * chore(package): update typescript to version 2.0.3 https://greenkeeper.io/ * Add customClass property to the Tab directive to make it easy to add class names to the outputted nav-items * tslint fix * Clicking on some tabs would sometime result in reloading the application (tested in Chrome). This will probably fix issue valor-software#842 which sounds exactly like the scenario this fixes for me.
The anchors in tabs handle normal clicks like this:
``(click)="tabz.active = true"
but clicks on remove are handled like this:
(click)="$event.preventDefault(); removeTab(tabz);"`Not sure under what circumstances exactly (couldn't reproduce in simple plunker) but after updating to RC 5 clicking on tabs in my application cause the app to reload (after my selected function completes). Adding $event.preventDefault(); to the anchor click function should prevent this behavior.
(Tested using jQuery
and that fixed the issue...)
The text was updated successfully, but these errors were encountered: