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

Dialog: When using blockScroll and the dialog is unmounted while being visible, scrolling continues to be blocked #4938

Closed
nicholas-brooks opened this issue Sep 20, 2023 · 3 comments · Fixed by #4939
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@nicholas-brooks
Copy link

Describe the bug

When using blockScroll in the Dialog component, and the dialog is unmounted whilst still being visible (e.g. navigating away using react-router), the scrolling of the main window remains blocked.

Refer to codesandbox example.

Reproducer

https://codesandbox.io/s/primereact-test-forked-y9dsx2?file=/src/index.js

PrimeReact version

9.6.2

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Set blockScroll in Dialog component
  2. Show dialog (visible = true)
  3. Unmount dialog without setting visible to false
  4. Note that scrolling remains blocked.

Expected behavior

Scrolling of the main window is restored.

@nicholas-brooks nicholas-brooks added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 20, 2023
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. Status: In Progress Core Team is working on the issue or pull request and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 20, 2023
@melloware
Copy link
Member

I will try and test this against 10.0.0 snapshot to see if it hasn't already been fixed. This might be related to another mounting issue I already fixed

@melloware melloware self-assigned this Sep 21, 2023
@melloware melloware added this to the 10.0.0 milestone Sep 21, 2023
melloware added a commit to melloware/primereact that referenced this issue Sep 21, 2023
@melloware melloware removed the Status: In Progress Core Team is working on the issue or pull request label Sep 21, 2023
@melloware
Copy link
Member

Thanks for the reproducer I was able to reproduce, debug and fix it.

@avasuro
Copy link
Contributor

avasuro commented Sep 21, 2023

@melloware

There are more circumstances when this bug appears, I've created separate ticket for that: #4940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants