Skip to content

Commit

Permalink
dont hide sticky elements
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski committed Jan 15, 2024
1 parent baa3d44 commit 2b54fd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/use-prevent-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ let restore;
*/
export function usePreventScroll(options: PreventScrollOptions = {}) {
let { isDisabled } = options;
console.log(isDisabled);

useIsomorphicLayoutEffect(() => {
if (isDisabled) {
Expand Down Expand Up @@ -121,7 +122,7 @@ export function usePreventScroll(options: PreventScrollOptions = {}) {
function preventScrollStandard() {
return chain(
setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`),
setStyle(document.documentElement, 'overflow', 'hidden'),
// setStyle(document.documentElement, 'overflow', 'hidden'),
);
}

Expand Down Expand Up @@ -252,7 +253,7 @@ function preventScrollMobileSafari() {

let restoreStyles = chain(
setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`),
setStyle(document.documentElement, 'overflow', 'hidden'),
// setStyle(document.documentElement, 'overflow', 'hidden'),
// setStyle(document.body, 'marginTop', `-${scrollY}px`),
);

Expand Down

0 comments on commit 2b54fd1

Please sign in to comment.