Fixed #5100 - DataTable: Cannot read properties of null when editMode="cell" and selectionMode="single"

pull/5128/head
mertsincan 2024-01-22 10:12:23 +00:00
parent f4c9f439a3
commit ee83f7d756
1 changed files with 2 additions and 2 deletions

View File

@ -794,9 +794,9 @@ export default {
this.rowTouched = false;
if (focusedItem) {
if (e.originalEvent.target.getAttribute('data-pc-section') === 'rowtogglericon' || e.originalEvent.target.parentElement.getAttribute('data-pc-section') === 'rowtogglericon') return;
if (event.target?.getAttribute('data-pc-section') === 'rowtogglericon' || event.target?.parentElement?.getAttribute('data-pc-section') === 'rowtogglericon') return;
const targetRow = e.originalEvent.target.closest('tr[data-p-selectable-row="true"]');
const targetRow = event.target?.closest('tr[data-p-selectable-row="true"]');
focusedItem.tabIndex = '-1';
targetRow.tabIndex = '0';