Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On useConfirm, apparent z-index changes as hostElement is reused #4280

Open
Rafatcb opened this issue Feb 17, 2024 · 5 comments
Open

On useConfirm, apparent z-index changes as hostElement is reused #4280

Rafatcb opened this issue Feb 17, 2024 · 5 comments

Comments

@Rafatcb
Copy link

Rafatcb commented Feb 17, 2024

Description

When using useConfirm, a hostElement is created to display the Dialog. As this hostElement is not removed from the DOM, when browsing, its position in the DOM changes from "last" to a higher position. This causes z-index: 1 to behave differently depending on the occasion on which confirm() is invoked.

Screencast.from.2024-02-17.09-28-04.webm

Steps to reproduce

Reproducible example: CodeSandbox.

  1. Click on the "Run confirm" button.
  2. Close the dialog.
  3. Click on the "Navigate to page 2" button.
  4. Click on the "Run confirm" button.

The yellow div will be above the Dialog.

Version

v35.10.0

Browser

Chrome, Firefox

@broccolinisoup
Copy link
Member

Hi @Rafatcb 👋 Thanks you for creating this issue. We can confirm that there is a bug here and it is in our backlog now.

You are welcome to raise a pull request to fix the bug. Thank you! 🙌

Copy link
Contributor

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 25, 2024
@Rafatcb
Copy link
Author

Rafatcb commented Aug 25, 2024

It's still an issue, but I wasn't able to update the package version in the CodeSandbox example due to the error:

ModuleNotFoundError
Could not find module in path: '@primer/react/lib/node_modules/@oddbird/popover-polyfill/dist/popover-fn.js' relative to '/node_modules/@primer/react/lib/TooltipV2/Tooltip.js'

Error on import { ThemeProvider, BaseStyles } from "@primer/react";

Copy link
Contributor

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 22, 2025
@mdjewel
Copy link

mdjewel commented Feb 23, 2025

Improve

@github-actions github-actions bot removed the Stale label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants