mirror of
https://github.com/jeffvli/sonixd.git
synced 2026-04-30 11:12:36 -04:00
Add disableRowClick prop to table
This commit is contained in:
@@ -91,6 +91,7 @@ const ListViewTable = ({
|
||||
handleDragEnd,
|
||||
miniView,
|
||||
dnd,
|
||||
disableRowClick,
|
||||
disableContextMenu,
|
||||
disabledContextMenuOptions,
|
||||
handleFavorite,
|
||||
@@ -161,20 +162,22 @@ const ListViewTable = ({
|
||||
const handleSelectMouseDown = (e: any, rowData: any) => {
|
||||
// If ctrl or shift is used, we want to ignore this drag selection handler
|
||||
// and use the ones provided in handleRowClick
|
||||
dispatch(setContextMenu({ show: false }));
|
||||
if (e.button === 0 && !e.ctrlKey && !e.shiftKey) {
|
||||
if (
|
||||
multiSelect.selected.length === 1 &&
|
||||
multiSelect.selected[0].uniqueId === rowData.uniqueId
|
||||
) {
|
||||
// Toggle single entry if the same entry is clicked
|
||||
dispatch(clearSelected());
|
||||
} else {
|
||||
if (multiSelect.selected.length > 0) {
|
||||
if (!disableRowClick) {
|
||||
dispatch(setContextMenu({ show: false }));
|
||||
if (e.button === 0 && !e.ctrlKey && !e.shiftKey) {
|
||||
if (
|
||||
multiSelect.selected.length === 1 &&
|
||||
multiSelect.selected[0].uniqueId === rowData.uniqueId
|
||||
) {
|
||||
// Toggle single entry if the same entry is clicked
|
||||
dispatch(clearSelected());
|
||||
} else {
|
||||
if (multiSelect.selected.length > 0) {
|
||||
dispatch(clearSelected());
|
||||
}
|
||||
dispatch(setIsSelectDragging(true));
|
||||
dispatch(toggleSelected(rowData));
|
||||
}
|
||||
dispatch(setIsSelectDragging(true));
|
||||
dispatch(toggleSelected(rowData));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user