Skip to content

Commit

Permalink
Fix #7436: Button tooltip prevent display order collision
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Dec 30, 2024
1 parent 5ae4498 commit 9b2dfa4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
/>
</div>
`;
8 changes: 5 additions & 3 deletions components/lib/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: {
Expand All @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "primereact",
"private": false,
"version": "10.8.5",
"version": "10.8.6",
"scripts": {
"dev": "next dev",
"start": "next start",
Expand All @@ -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 .",
Expand Down

0 comments on commit 9b2dfa4

Please sign in to comment.