Skip to content

Commit bbf0fbb

Browse files
committed
Fix show/hide duration for slide over
1 parent 74d7120 commit bbf0fbb

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

lib/petal_components/slide_over.ex

+6-16
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,13 @@ defmodule PetalComponents.SlideOver do
9797
|> JS.show(to: "#slide-over")
9898
|> JS.show(
9999
to: "#slide-over-overlay",
100+
time: 300,
100101
transition: {"transition-all transform ease-out duration-300", "opacity-0", "opacity-100"}
101102
)
102103
|> JS.show(
103104
to: "#slide-over-content",
104-
transition: {
105-
"transition-all transform ease-out duration-300",
106-
start_class,
107-
end_class
108-
}
105+
time: 300,
106+
transition: {"transition-all transform ease-out duration-300", start_class, end_class}
109107
)
110108
|> JS.add_class("overflow-hidden", to: "body")
111109
|> JS.focus_first(to: "#slide-over-content")
@@ -121,22 +119,14 @@ defmodule PetalComponents.SlideOver do
121119
js =
122120
JS.remove_class("overflow-hidden", to: "body")
123121
|> JS.hide(
124-
transition: {
125-
"ease-in duration-200",
126-
"opacity-100",
127-
"opacity-0"
128-
},
122+
transition: {"ease-in duration-200", "opacity-100", "opacity-0"},
129123
to: "#slide-over-overlay"
130124
)
131125
|> JS.hide(
132-
transition: {
133-
"ease-in duration-200",
134-
start_class,
135-
end_class
136-
},
126+
transition: {"ease-in duration-200", start_class, end_class},
137127
to: "#slide-over-content"
138128
)
139-
|> JS.hide(to: "#slide-over")
129+
|> JS.hide(to: "#slide-over", transition: {"duration-200", "", ""})
140130

141131
if close_slide_over_target do
142132
JS.push(js, "close_slide_over", target: close_slide_over_target)

0 commit comments

Comments
 (0)