Skip to content

Bug: usePreventScroll is not disabled scroll behavior in ipad and iphone #9413

@AmelloAster

Description

@AmelloAster

Provide a general summary of the issue here

// Prevent scrolling the window. if (!scrollable || scrollable === document.documentElement || scrollable === document.body) { e.preventDefault(); return; }
The issue mainly occurs in this section of the code: when I open a full-screen dialog on an iPad and use usePreventScroll({isDisable: !isOpen}), the DOM element retrieved by scrollable here is not the body—it’s the dialog instead. This causes the judgment here to fail, and scrolling cannot be disabled properly.

🤔 Expected Behavior?

disable scroll can be work

😯 Current Behavior

disable scroll can not work

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

when I open a full-screen dialog on an iPad and use usePreventScroll({isDisable: !isOpen}), the DOM element retrieved by scrollable here is not the body—it’s the dialog instead. This causes the judgment here to fail, and scrolling cannot be disabled properly.

Version

latest

What browsers are you seeing the problem on?

Safari

If other, please specify.

No response

What operating system are you using?

macos

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions