Skip to content

Commit

Permalink
Allow ignore of data-tag in CellEdit outside click
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawjaren committed Nov 20, 2024
1 parent 9cb5e0a commit 98200e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/lib/datatable/BodyCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ export const BodyCell = React.memo((props) => {
return getColumnProp('cellEditValidateOnClose');
};

const isIgnoredElement = (element) => {
const isCellEditor = (el) => el.getAttribute && el.getAttribute('data-pr-is-overlay');
return isCellEditor(element) || DomHandler.getParents(element).find((el) => isCellEditor(el));
};

const [bindDocumentClickListener, unbindDocumentClickListener] = useEventListener({
type: 'click',
listener: (e) => {
if (isIgnoredElement(e.target)) {
return
}
setTimeout(() => {
if (!selfClick.current && isOutsideClicked(e.target)) {
// #2666 for overlay components and outside is clicked
Expand Down

0 comments on commit 98200e4

Please sign in to comment.