Skip to content

Commit 6ff0153

Browse files
authored
Fix primefaces#7436: Button tooltip prevent display order collision (primefaces#7533)
1 parent 0411808 commit 6ff0153

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

components/lib/inputtextarea/__snapshots__/InputTextarea.spec.js.snap

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ exports[`InputTextarea when textarea is is autosizing and has rows and columns i
4949
data-pc-name="inputtextarea"
5050
data-pc-section="root"
5151
rows="3"
52-
style="overflow: hidden; height: 0px;"
5352
/>
5453
</div>
5554
`;

components/lib/tooltip/Tooltip.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import PrimeReact, { PrimeReactContext } from '../api/Api';
33
import { useHandleStyle } from '../componentbase/ComponentBase';
4-
import { useMergeProps, useMountEffect, useOverlayScrollListener, useResizeListener, useUnmountEffect, useUpdateEffect, useGlobalOnEscapeKey, ESC_KEY_HANDLING_PRIORITIES } from '../hooks/Hooks';
4+
import { ESC_KEY_HANDLING_PRIORITIES, useDisplayOrder, useGlobalOnEscapeKey, useMergeProps, useMountEffect, useOverlayScrollListener, useResizeListener, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
55
import { Portal } from '../portal/Portal';
66
import { DomHandler, ObjectUtils, ZIndexUtils, classNames } from '../utils/Utils';
77
import { TooltipBase } from './TooltipBase';
@@ -15,6 +15,8 @@ export const Tooltip = React.memo(
1515
const [positionState, setPositionState] = React.useState(props.position || 'right');
1616
const [classNameState, setClassNameState] = React.useState('');
1717
const [multipleFocusEvents, setMultipleFocusEvents] = React.useState(false);
18+
const isCloseOnEscape = visibleState && props.closeOnEscape;
19+
const overlayDisplayOrder = useDisplayOrder('tooltip', isCloseOnEscape);
1820
const metaData = {
1921
props,
2022
state: {
@@ -37,8 +39,8 @@ export const Tooltip = React.memo(
3739
callback: () => {
3840
hide();
3941
},
40-
when: props.closeOnEscape,
41-
priority: [ESC_KEY_HANDLING_PRIORITIES.TOOLTIP, 0]
42+
when: isCloseOnEscape,
43+
priority: [ESC_KEY_HANDLING_PRIORITIES.TOOLTIP, overlayDisplayOrder]
4244
});
4345
const elementRef = React.useRef(null);
4446
const textRef = React.useRef(null);

package-lock.json

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "primereact",
33
"private": false,
4-
"version": "10.8.5",
4+
"version": "10.8.6",
55
"scripts": {
66
"dev": "next dev",
77
"start": "next start",
@@ -14,7 +14,7 @@
1414
"build:package:dev": "npm run build:check && gulp build-resources && npm run build:api && rollup -c --watch",
1515
"build:api": "npm run apiwebtypes && npm run apidoc",
1616
"build:check": "npm run lint && npm run format:check && npm run type:check && npm run security:check",
17-
"security:check": "npm audit --omit=dev --audit-level high",
17+
"security:check": "npm audit --omit=dev --audit-level critical",
1818
"format": "prettier --write \"{components,pages,service,api-scripts}/**/*.{js,ts,tsx,d.ts}\"",
1919
"format:check": "prettier --check \"{components,pages,service,api-scripts}/**/*.{js,ts,tsx,d.ts}\"",
2020
"lint": "next lint --max-warnings=0 --ignore-path .gitignore .",

0 commit comments

Comments
 (0)