Skip to content

Commit

Permalink
fix: DragHandler fix for BottomSheet (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrey authored Dec 4, 2023
1 parent 0dac1ff commit 6ef2d5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/hooks/bottom_sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {

mounted() {
Animation.mounted.bind(this)();
this.dragHandle = this.el.querySelector(".moon-drag-handle");
this.dragHandle = this.el.querySelector(" & > .moon-panel > .bottom_sheet_header > .moon-drag-handle")
},

updated() {
Expand Down
2 changes: 1 addition & 1 deletion lib/moon/design/bottom_sheet/header.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Moon.Design.BottomSheet.Header do
{=@id}
class={merge([
[
"sticky top-0 z-10 bg-goku pt-1",
"sticky top-0 z-10 bg-goku pt-1 bottom_sheet_header",
"min-h-[48px]": slot_assigned?(:drag_handle)
],
@class
Expand Down
3 changes: 3 additions & 0 deletions lib/moon_web/examples/design/bottom_sheet_example/double.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ defmodule MoonWeb.Examples.Design.BottomSheetExample.Double do
</Button>
<BottomSheet id="default_bottom_sheet2">
<BottomSheet.Panel>
<BottomSheet.Header class="border-b-2 border-beerus">
<BottomSheet.DragHandle />
</BottomSheet.Header>
<div class="flex grow items-center justify-center bg-jiren text-piccolo">
Bottom Sheet content2
</div>
Expand Down

0 comments on commit 6ef2d5c

Please sign in to comment.