Subscription on onSelectedRangesChanged
Opened this issue · 0 comments
Hi.
There's some code in init
method of cellextenalcopymanager which seems weird for me:
function init(grid) {
// we give focus on the grid when a selection is done on it.
// without this, if the user selects a range of cell without giving focus on a particular cell, the grid doesn't get the focus and key stroke handles (ctrl+c) don't work
cellSelectionModel.onSelectedRangesChanged.subscribe(function(e, args){
_grid.focus();
});
}
So on any selection change grid will got focus. I understand that it could be important for copy/paste but it's simply incorrect in general.
Just realize that we have several grids on a page. And before grids were rendered our code sets up initial selection. So when grids are finally rendered the latest one will get focus. It can (and does) create an annoying effect for the user.
Moreover the plugin doesn't unsubscribes from onSelectedRangesChanged event in destroy
.
Could you clarify why the subscription is really needed: how the user can select a range of cells without giving focus on a grid. I tried to comment out the code and the plugin still works for me.