ngx-datatable
ngx-datatable copied to clipboard
'activate' event reports incorrect row/value
I'm submitting a ... (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior Take a look at http://swimlane.github.io/ngx-datatable/#cell-selection. Open dev tools and move selection around with arrow keys. You'll see that 'value' field lags behind what's selected.
The bug is here:
onActivate(model: Model, index: number): void {
const { type, event, row } = model;
const chkbox = this.selectionType === SelectionType.checkbox;
const select = (!chkbox && (type === 'click' || type === 'dblclick')) ||
(chkbox && type === 'checkbox');
if(select) {
this.selectRow(event, index, row);
} else if(type === 'keydown') {
if ((<KeyboardEvent>event).keyCode === Keys.return) {
this.selectRow(event, index, row);
} else {
this.onKeyboardFocus(model);
}
}
this.activate.emit(model);
}
onKeyboardFocus
will move current cell/row, and activate.emit(model)
reports stale information.
Expected behavior 'activate' event should report active cell/row.
Reproduction of the problem It's here: http://swimlane.github.io/ngx-datatable/#cell-selection
-
Table version: 0.9.2
-
Angular version: 4.1.x
Is there any workaround for this issue?
Need a fix for this issue
This is a serious issue needed to be fixed on priority.
If we have a fix for this issue, will helps a lot please consider as a priority issue.
we need this issue to be fixed as its important for us. Please let us know anyone is working on this? @mikekov do you have any other solution to fix this issue?