Skip to content

Commit

Permalink
fix: tree drag and drop possible when droppable prop is default of un…
Browse files Browse the repository at this point in the history
…defined (primefaces#7181)
  • Loading branch information
pascalbaetz authored Sep 13, 2024
1 parent 0bbd86b commit 78277e0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions components/lib/tree/UITreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,15 @@ export const UITreeNode = React.memo((props) => {
const contentProps = mergeProps(
{
ref: contentRef,
className: classNames(props.node.className, cx('content', { checked, selected, nodeProps: props, isCheckboxSelectionMode })),
className: classNames(
props.node.className,
cx('content', {
checked,
selected,
nodeProps: props,
isCheckboxSelectionMode
})
),
style: props.node.style,
onClick: onClick,
onDoubleClick: onDoubleClick,
Expand Down Expand Up @@ -961,7 +969,6 @@ export const UITreeNode = React.memo((props) => {
'aria-setsize': props.node.children ? props.node.children.length : 0,
'aria-posinset': props.index + 1,
onKeyDown: onKeyDown,
'aria-expanded': expanded,
'aria-selected': checked || selected
},
getPTOptions('node')
Expand All @@ -977,7 +984,7 @@ export const UITreeNode = React.memo((props) => {

const node = createNode();

if (props.dragdropScope && !props.disabled && (!props.parent || props.parent.droppable)) {
if (props.dragdropScope && !props.disabled && (!props.parent || props.parent.droppable !== false)) {
const beforeDropPoint = createDropPoint(-1);
const afterDropPoint = props.last ? createDropPoint(1) : null;

Expand Down

0 comments on commit 78277e0

Please sign in to comment.