Fixed #5783 - Datatable: Focus issue on tab

pull/5858/head
tugcekucukoglu 2024-06-07 15:43:14 +03:00
parent 508428fdc7
commit 4e476df1bd
1 changed files with 8 additions and 16 deletions

View File

@ -390,39 +390,31 @@ export default {
} }
}, },
findPreviousEditableColumn(cell) { findPreviousEditableColumn(cell) {
let prevCell = cell.previousElementSibling; let prevCell = cell?.previousElementSibling;
if (!prevCell) { if (!prevCell) {
let previousRow = cell.parentElement.previousElementSibling; let previousRow = cell?.parentElement.previousElementSibling;
if (previousRow) { if (previousRow) {
prevCell = previousRow.lastElementChild; prevCell = previousRow.lastElementChild;
} } else return null;
} } else {
if (prevCell) {
if (DomHandler.getAttribute(prevCell, 'data-p-editable-column')) return prevCell; if (DomHandler.getAttribute(prevCell, 'data-p-editable-column')) return prevCell;
else return this.findPreviousEditableColumn(prevCell); else return this.findPreviousEditableColumn(prevCell);
} else {
return null;
} }
}, },
findNextEditableColumn(cell) { findNextEditableColumn(cell) {
let nextCell = cell.nextElementSibling; let nextCell = cell?.nextElementSibling;
if (!nextCell) { if (!nextCell) {
let nextRow = cell.parentElement.nextElementSibling; let nextRow = cell?.parentElement.nextElementSibling;
if (nextRow) { if (nextRow) {
nextCell = nextRow.firstElementChild; nextCell = nextRow.firstElementChild;
} } else return null;
} } else {
if (nextCell) {
if (DomHandler.getAttribute(nextCell, 'data-p-editable-column')) return nextCell; if (DomHandler.getAttribute(nextCell, 'data-p-editable-column')) return nextCell;
else return this.findNextEditableColumn(nextCell); else return this.findNextEditableColumn(nextCell);
} else {
return null;
} }
}, },
onRowEditInit(event) { onRowEditInit(event) {