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 · 1 comment
Open

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

Rafatcb opened this issue Feb 17, 2024 · 1 comment

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! 🙌

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

2 participants