-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cellNav in 3.0.0-rc.16 preventing ng-click in rowTemplate to fire. #2109
Comments
@c0bra: did you come across this during the cellNav rewrite at all? |
I am also got confused when saw click event handler and evt.stopPropagation() in the ui.grid.cellNav.directive:uiGridCell directive. @c0bra: Will it be possible to separate clicking and key navigation? |
I have the same issue in rc-19. In row-template ng-click work-only if cellNav is not used. |
We're seeing a similar regression moving from rc-18 to rc-19. |
Did you move to the new appScope instead of getExternalScope? |
I tried that and it didn't seem to help. |
No progress on a plunker for some time....assuming that this issue is resolved. |
This still seems to cause issues. One issue in particular is with draggable rows. The plugin ui-grid-draggable-rows relies on the drag events to rearrange the rows. It looks like on line 14850-14871 the mousedown events are being prevented, which causes the functionality of the drag and drop rows to be ceased. I created a jsbin that shows the issue: https://jsbin.com/nomixu/3/edit?html,js,output I have been trying to figure out all day why the row reordering hasnt been working with cellnav and this thread led me to find out that it was the preventMouseDown() function that was causing the drag and drop rows functionality to stop working. I solved my problem by using evt.stopPropagation() instead of evt.preventDefault() near line 14867 /*
* XXX Hack for screen readers.
* This allows the grid to focus using only the screen reader cursor.
* Since the focus event doesn't include key press information we can't use it
* as our primary source of the event.
*/
$elm.on('mousedown', preventMouseDown);
//turn on and off for edit events
if (uiGridCtrl.grid.api.edit) {
uiGridCtrl.grid.api.edit.on.beginCellEdit($scope, function () {
$elm.off('mousedown', preventMouseDown);
});
uiGridCtrl.grid.api.edit.on.afterCellEdit($scope, function () {
$elm.on('mousedown', preventMouseDown);
});
uiGridCtrl.grid.api.edit.on.cancelCellEdit($scope, function () {
$elm.on('mousedown', preventMouseDown);
});
}
function preventMouseDown(evt) {
//Prevents the foucus event from firing if the click event is already going to fire.
//If both events fire it will cause bouncing behavior.
//evt.preventDefault();
evt.stopPropagation();
} |
Hi Angular UI team,
ui-grid 3.0.0 being working great for us. Thanks a lot for this awesome new version.
Before rc.16, I'm using
rowTemplate
withng-click
in the same way as the example in http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions. It was working great withselection
andcellNav
plugin.Since rc.16, when I have cellNav enabled, it is preventing the
ng-click
from firing. This could be introduced with the recent improvement in #2084.Actually, what I'm trying to achieve from these plugins
IMO,
scrollToRow
is a basic grid usage which should be an API of the grid, instead of bundled together withcellNav
. Or can be a separate plugin calledrowNav
.Workarounds that I have tried:
gridApi.selection.selectRow()
innavigate
event handler instead ofng-click
in templatecellNav
pluginng-click
so I can click and select a row even whenenableRowHeaderSelection
is true.evt.stopPropagation();
insideuiGridCell
directive's onclick
even handlerI will stick with rc.15 for now.
Thanks,
Greg
The text was updated successfully, but these errors were encountered: