Skip to content

Commit

Permalink
Fix primefaces#5035: ContextMenu not passing data
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Oct 5, 2023
1 parent ef51807 commit 0c91e89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/lib/datatable/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,11 @@ export const TableBody = React.memo(
};

const onRowRightClick = (event) => {
const isMultiSelection = isCheckboxSelectionModeInColumn && ObjectUtils.isEmpty(props.selection);
const data = isMultiSelection ? event.data : props.selection;

if (props.onContextMenu || props.onContextMenuSelectionChange) {
if (!ObjectUtils.isEmpty(props.selection)) DomHandler.clearSelection();
const hasSelection = ObjectUtils.isNotEmpty(props.selection);
const data = hasSelection ? props.selection : event.data;

if (hasSelection) DomHandler.clearSelection();

if (props.onContextMenuSelectionChange) {
props.onContextMenuSelectionChange({
Expand Down

0 comments on commit 0c91e89

Please sign in to comment.