Skip to content

Commit

Permalink
Don't hide sticky elements (#209)
Browse files Browse the repository at this point in the history
* dont hide sticky elements

* Remove console log
  • Loading branch information
emilkowalski authored Jan 15, 2024
1 parent baa3d44 commit e106e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/use-prevent-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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 +252,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

1 comment on commit e106e03

@damiaanh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emilkowalski Are you sure this is correct? for me commenting out the setStyle overflow hidden, kinda removes the whole purpose of this hook for non-IOS or Apple devices.

Please sign in to comment.