fix: prevent modal clicks from closing when used in booking list (#25153)

This commit is contained in:
Anik Dhabal Babu
2025-11-14 11:47:34 +00:00
committed by GitHub
parent 919fc3cdd5
commit 8043505f3a
@@ -400,7 +400,14 @@ function DataTableBody<TData>({
{...computedDataAttributes}
data-index={virtualItem?.index} // needed for dynamic row height measurement
data-state={row.getIsSelected() && "selected"}
onClick={() => onRowMouseclick && onRowMouseclick(row)}
onClick={(e) => {
if (!onRowMouseclick) return;
const target = e.target as Node | null;
const current = e.currentTarget as HTMLElement | null;
// Only invoke the handler when the event target is inside the row element.
if (!target || !current || !current.contains(target)) return;
onRowMouseclick(row);
}}
style={{
display: "flex",
...(virtualItem && {