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

[Bug]: Closed modal is retained as a detached element #25093

Closed
2 tasks done
AndrewBarzu opened this issue Oct 5, 2022 · 1 comment
Closed
2 tasks done

[Bug]: Closed modal is retained as a detached element #25093

AndrewBarzu opened this issue Oct 5, 2022 · 1 comment
Labels
Fluent UI react (v8) Issues about @fluentui/react (v8)

Comments

@AndrewBarzu
Copy link

Library

React / v8 (@fluentui/react)

System Info

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
    Memory: 25.08 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Browsers:
    Chrome: 105.0.5195.125
    Safari: 16.0

Are you reporting Accessibility issue?

No response

Reproduction

https://codesandbox.io/s/z388du?file=/src/index.tsx

Bug Description

Actual Behavior

In edge:

  1. Open Modal
  2. Close Modal
  3. Look into detached elements
  4. Press "Get Detached Elements"
  5. Press "Analyze"
  6. Press again "Get Detached Elements"
  7. The modal is left in detached elements

Screenshot 2022-10-05 at 15 45 52

Expected Behavior

The modal should not be retained as a detached element. Even though this does not cause a bad memory leak (memory does not continue bloating) it's still bad because sensitive information can still be leaked from the modal.

Logs

No response

Requested priority

Normal

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@github-actions github-actions bot added the Fluent UI react (v8) Issues about @fluentui/react (v8) label Oct 5, 2022
@miroslavstastny
Copy link
Member

This is actually React working as intended and there's nothing we can actually do about it.
Also this is not what we've considered a real leak since the detached HTML element count does not actually increase. React will keep two separate trees in memory for optimization purposes and there is an open issue on their end stating that detached elements in alternate trees won't be fixed any time soon facebook/react#16087.

fyi @ling1726

@microsoft microsoft locked as resolved and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fluent UI react (v8) Issues about @fluentui/react (v8)
Projects
None yet
Development

No branches or pull requests

3 participants