@fenderdigital/react-off-canvas
Advanced tools
Comparing version
@@ -84,6 +84,2 @@ 'use strict'; | ||
if (isVisible !== prevIsVisible) this.toggleState(); | ||
if ((0, _dom2.default)()) { | ||
var body = document.querySelector('html'); | ||
body.className = isVisible ? 'overflow-hidden' : ''; | ||
} | ||
}; | ||
@@ -102,2 +98,6 @@ | ||
onCallback({ isVisible: isVisible }); | ||
if ((0, _dom2.default)()) { | ||
var html = document.querySelector('html'); | ||
html.className = isVisible ? 'overflow-hidden' : ''; | ||
} | ||
}); | ||
@@ -104,0 +104,0 @@ }; |
@@ -30,3 +30,3 @@ { | ||
}, | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"dependencies": { | ||
@@ -33,0 +33,0 @@ "@fenderdigital/dom": "^1.0.6" |
@@ -15,6 +15,2 @@ import React from 'react'; | ||
if (isVisible !== prevIsVisible) this.toggleState(); | ||
if (isDomUsuable()) { | ||
const body = document.querySelector('html'); | ||
body.className = isVisible ? 'overflow-hidden' : ''; | ||
} | ||
} | ||
@@ -64,2 +60,6 @@ getPlacement = placement => { | ||
onCallback({ isVisible }); | ||
if (isDomUsuable()) { | ||
const html = document.querySelector('html'); | ||
html.className = isVisible ? 'overflow-hidden' : ''; | ||
} | ||
}, | ||
@@ -66,0 +66,0 @@ ); |
163488
0.01%