From 6ff0153933cd5f8788e53f5e8b255f0e804c6e1e Mon Sep 17 00:00:00 2001 From: Melloware Date: Mon, 30 Dec 2024 10:51:38 -0500 Subject: [PATCH] Fix #7436: Button tooltip prevent display order collision (#7533) --- .../__snapshots__/InputTextarea.spec.js.snap | 1 - components/lib/tooltip/Tooltip.js | 8 +++++--- package-lock.json | 11 ++++++----- package.json | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/components/lib/inputtextarea/__snapshots__/InputTextarea.spec.js.snap b/components/lib/inputtextarea/__snapshots__/InputTextarea.spec.js.snap index fd69882c74..803d65b5d9 100644 --- a/components/lib/inputtextarea/__snapshots__/InputTextarea.spec.js.snap +++ b/components/lib/inputtextarea/__snapshots__/InputTextarea.spec.js.snap @@ -49,7 +49,6 @@ exports[`InputTextarea when textarea is is autosizing and has rows and columns i data-pc-name="inputtextarea" data-pc-section="root" rows="3" - style="overflow: hidden; height: 0px;" /> `; diff --git a/components/lib/tooltip/Tooltip.js b/components/lib/tooltip/Tooltip.js index 8e58e5d886..abfd2ed020 100644 --- a/components/lib/tooltip/Tooltip.js +++ b/components/lib/tooltip/Tooltip.js @@ -1,7 +1,7 @@ import * as React from 'react'; import PrimeReact, { PrimeReactContext } from '../api/Api'; import { useHandleStyle } from '../componentbase/ComponentBase'; -import { useMergeProps, useMountEffect, useOverlayScrollListener, useResizeListener, useUnmountEffect, useUpdateEffect, useGlobalOnEscapeKey, ESC_KEY_HANDLING_PRIORITIES } from '../hooks/Hooks'; +import { ESC_KEY_HANDLING_PRIORITIES, useDisplayOrder, useGlobalOnEscapeKey, useMergeProps, useMountEffect, useOverlayScrollListener, useResizeListener, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks'; import { Portal } from '../portal/Portal'; import { DomHandler, ObjectUtils, ZIndexUtils, classNames } from '../utils/Utils'; import { TooltipBase } from './TooltipBase'; @@ -15,6 +15,8 @@ export const Tooltip = React.memo( const [positionState, setPositionState] = React.useState(props.position || 'right'); const [classNameState, setClassNameState] = React.useState(''); const [multipleFocusEvents, setMultipleFocusEvents] = React.useState(false); + const isCloseOnEscape = visibleState && props.closeOnEscape; + const overlayDisplayOrder = useDisplayOrder('tooltip', isCloseOnEscape); const metaData = { props, state: { @@ -37,8 +39,8 @@ export const Tooltip = React.memo( callback: () => { hide(); }, - when: props.closeOnEscape, - priority: [ESC_KEY_HANDLING_PRIORITIES.TOOLTIP, 0] + when: isCloseOnEscape, + priority: [ESC_KEY_HANDLING_PRIORITIES.TOOLTIP, overlayDisplayOrder] }); const elementRef = React.useRef(null); const textRef = React.useRef(null); diff --git a/package-lock.json b/package-lock.json index de5ac03635..31234ea2b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "primereact", - "version": "10.8.5", + "version": "10.8.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "primereact", - "version": "10.8.5", + "version": "10.8.6", "dependencies": { "@docsearch/react": "3.6.2", "chart.js": "4.4.7", @@ -6384,10 +6384,11 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", diff --git a/package.json b/package.json index 5e58f98d21..d29a27c4b5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "primereact", "private": false, - "version": "10.8.5", + "version": "10.8.6", "scripts": { "dev": "next dev", "start": "next start", @@ -14,7 +14,7 @@ "build:package:dev": "npm run build:check && gulp build-resources && npm run build:api && rollup -c --watch", "build:api": "npm run apiwebtypes && npm run apidoc", "build:check": "npm run lint && npm run format:check && npm run type:check && npm run security:check", - "security:check": "npm audit --omit=dev --audit-level high", + "security:check": "npm audit --omit=dev --audit-level critical", "format": "prettier --write \"{components,pages,service,api-scripts}/**/*.{js,ts,tsx,d.ts}\"", "format:check": "prettier --check \"{components,pages,service,api-scripts}/**/*.{js,ts,tsx,d.ts}\"", "lint": "next lint --max-warnings=0 --ignore-path .gitignore .",