diff --git a/components/molecule/drawer/demo/DemoPageScrollable.js b/components/molecule/drawer/demo/DemoPageScrollable.js index 30bbd4fbe7..401cbdee0b 100644 --- a/components/molecule/drawer/demo/DemoPageScrollable.js +++ b/components/molecule/drawer/demo/DemoPageScrollable.js @@ -14,6 +14,9 @@ const DemoPageScroll = ({className}) => {

Page scroll

The drawer can avoid the page to scroll when is opened + + Test on mobile: Open drawer and try scrolling the background. It should be locked! + OPEN} checked={opened} onClick={() => setOpened(!opened)} />

@@ -37,7 +40,21 @@ const DemoPageScroll = ({className}) => { ref={drawerRef} closeOnOutsideClick > -

None

+
+

Drawer Content (should scroll)

+ + {Array.from({length: 30}, (_, i) => ( + + Drawer item #{i + 1} - This content should scroll smoothly on iOS. The background should remain locked + even when you focus the input and the keyboard appears. + + ))} +
diff --git a/components/molecule/drawer/src/index.js b/components/molecule/drawer/src/index.js index 301d45bdc2..a822735a58 100644 --- a/components/molecule/drawer/src/index.js +++ b/components/molecule/drawer/src/index.js @@ -65,8 +65,15 @@ const MoleculeDrawer = forwardRef( } }) - const blockScrollPage = () => (document.body.style.overflow = 'hidden') - const enableScrollPage = () => (document.body.style.overflow = 'auto') + const blockScrollPage = () => { + document.body.style.overflow = 'hidden' + document.body.style.touchAction = 'none' + } + + const enableScrollPage = () => { + document.body.style.overflow = 'auto' + document.body.style.touchAction = 'auto' + } return (