Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Add fixed height prop

emilkowalski430b3130bcfe
diff --git a/src/index.tsx b/src/index.tsx
index 9bb5135..3c4d17c 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -91,7 +91,7 @@ function Root({
const initialViewportHeight = React.useRef(0);
usePreventScroll({
- isDisabled: !isOpen || isDragging,
+ isDisabled: !isOpen || isDragging || fixedHeight,
});
function getScale() {
@@ -129,7 +129,7 @@ function Root({
while (element) {
// Check if the element is scrollable
if (element.scrollHeight > element.clientHeight) {
- if (element.getAttribute('vaul-drawer')) return true;
+ if (element.role === 'dialog' || element.getAttribute('vaul-drawer')) return true;
if (element.scrollTop > 0) {
lastTimeDragPrevented.current = new Date();