Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ header {
display: flex;
flex-direction: column;
background: #fff;
box-shadow: 0 24px 0 0 #fff, 0 0 12px 0 rgba(0, 0, 0, 0.3), 0 0 24px 12px rgba(0, 0, 0, 0.1);
box-shadow: 0 24px 0 0 #fff, 0 0 12px 0 rgba(0, 0, 0, 0.3),
0 0 24px 12px rgba(0, 0, 0, 0.1);
scroll-snap-align: start;
}

Expand All @@ -139,7 +140,8 @@ header {
margin-bottom: 3.75rem;
outline: 0px;
background-color: rgb(255, 255, 255);
box-shadow: rgba(0, 0, 0, 0.1) 0px 7px 14px 0px, rgba(0, 0, 0, 0.07) 0px 3px 6px 0px;
box-shadow: rgba(0, 0, 0, 0.1) 0px 7px 14px 0px,
rgba(0, 0, 0, 0.07) 0px 3px 6px 0px;
}
}

Expand Down
22 changes: 9 additions & 13 deletions swipeable-bottom-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SwipeableBottomSheet {
...defaultOptions,
...options,
};

this.isInteractive = false;
// Get the bottomsheet and trigger
const bottomSheetNode = document.getElementById(this.options.bottomSheetId);

Expand Down Expand Up @@ -325,21 +325,17 @@ class SwipeableBottomSheet {
}

enableInteractivity() {
if (!this.isInteractive) {
this.isInteractive = true;
// Add interactivity to the bottomsheet
this.clonedBottomSheet.classList.add("interactive");
bodyScrollLock.disableBodyScroll(this.clonedBottomSheet);
}
this.isInteractive = true;
// Add interactivity to the bottomsheet
this.clonedBottomSheet.classList.add("interactive");
bodyScrollLock.disableBodyScroll(this.clonedBottomSheet);
}

disableInteractivity() {
if (this.isInteractive) {
this.isInteractive = false;
// Remove interactivity from the bottomsheet
this.clonedBottomSheet.classList.remove("interactive");
bodyScrollLock.enableBodyScroll(this.clonedBottomSheet);
}
this.isInteractive = false;
// Remove interactivity from the bottomsheet
this.clonedBottomSheet.classList.remove("interactive");
bodyScrollLock.enableBodyScroll(this.clonedBottomSheet);
}

toggleInteractivity(e) {
Expand Down