diff --git a/src/components/Menu/Menu.unit.test.tsx.snap b/src/components/Menu/Menu.unit.test.tsx.snap index 61bd6a5f2..69d277d5a 100644 --- a/src/components/Menu/Menu.unit.test.tsx.snap +++ b/src/components/Menu/Menu.unit.test.tsx.snap @@ -3161,6 +3161,7 @@ exports[` snapshot should match snapshot with seperator between items 1` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -3443,6 +3444,7 @@ exports[` snapshot should match snapshot with seperator between items 1` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -4461,6 +4463,7 @@ exports[` snapshot should match snapshot with seperator within section 1 onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -5001,6 +5004,7 @@ exports[` snapshot should match snapshot with seperator within section 1 onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -6009,6 +6013,7 @@ exports[` snapshot should match snapshot with seperator within section 1 onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -6549,6 +6554,7 @@ exports[` snapshot should match snapshot with seperator within section 1 onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -7682,6 +7688,7 @@ exports[` snapshot should match snapshot with seperator within selection onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -8272,6 +8279,7 @@ exports[` snapshot should match snapshot with seperator within selection onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -9392,6 +9400,7 @@ exports[` snapshot should match snapshot with seperator within selection onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -9982,6 +9991,7 @@ exports[` snapshot should match snapshot with seperator within selection onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -10244,6 +10254,7 @@ exports[` snapshot should match snapshot with style 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -10474,6 +10485,7 @@ exports[` snapshot should match snapshot with style 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -10725,6 +10737,7 @@ exports[` snapshot should match snapshot with tickPosition 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -10966,6 +10979,7 @@ exports[` snapshot should match snapshot with tickPosition 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} diff --git a/src/components/MenuSection/MenuSection.unit.test.tsx.snap b/src/components/MenuSection/MenuSection.unit.test.tsx.snap index afacf7a72..6bdda2e74 100644 --- a/src/components/MenuSection/MenuSection.unit.test.tsx.snap +++ b/src/components/MenuSection/MenuSection.unit.test.tsx.snap @@ -1325,6 +1325,7 @@ exports[` snapshot should match snapshot with seperator 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -1650,6 +1651,7 @@ exports[` snapshot should match snapshot with seperator 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} diff --git a/src/components/MenuSelectionGroup/MenuSelectionGroup.unit.test.tsx.snap b/src/components/MenuSelectionGroup/MenuSelectionGroup.unit.test.tsx.snap index 0d9f9537c..a6d9b112a 100644 --- a/src/components/MenuSelectionGroup/MenuSelectionGroup.unit.test.tsx.snap +++ b/src/components/MenuSelectionGroup/MenuSelectionGroup.unit.test.tsx.snap @@ -564,6 +564,7 @@ exports[` snapshot should match snapshot 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -877,6 +878,7 @@ exports[` snapshot should match snapshot 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -1562,6 +1564,7 @@ exports[` snapshot should match snapshot with seperator wi onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} @@ -1927,6 +1930,7 @@ exports[` snapshot should match snapshot with seperator wi onMouseEnter={[Function]} onMouseLeave={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} onTouchCancel={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} diff --git a/src/components/TreeNodeBase/TreeNodeBase.tsx b/src/components/TreeNodeBase/TreeNodeBase.tsx index f2178ff66..d15d8ee4d 100644 --- a/src/components/TreeNodeBase/TreeNodeBase.tsx +++ b/src/components/TreeNodeBase/TreeNodeBase.tsx @@ -56,6 +56,7 @@ const TreeNodeBase = (props: Props, providedRef: TreeNodeBaseRefOrCallbackRef): const internalRef = useRef(); const ref = providedRef && typeof providedRef !== 'function' ? providedRef : internalRef; const isHidden = !nodeDetails || nodeDetails.isHidden; + const isLeaf = nodeDetails?.isLeaf; // When used in a popover, the ref will be a callback. // We need to update this callback ref, so the popover @@ -115,14 +116,14 @@ const TreeNodeBase = (props: Props, providedRef: TreeNodeBaseRefOrCallbackRef): if ( treeContext && treeContext.itemSelection.selectionMode !== 'none' && - (treeContext.selectableNodes === 'any' || nodeDetails?.isLeaf) + (treeContext.selectableNodes === 'any' || isLeaf) ) { treeContext.itemSelection.toggle(nodeId); } onPress?.(event); }, - [treeContext, nodeDetails.isLeaf, onPress, ref, nodeId] + [treeContext, isLeaf, onPress, ref, nodeId] ); const { pressProps, isPressed } = usePress({