Skip to content

Commit

Permalink
Fix dialog hide animation
Browse files Browse the repository at this point in the history
  • Loading branch information
bluzky committed Jun 26, 2024
1 parent 092857a commit 9733c08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/salad_ui/dialog.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ defmodule SaladUI.Dialog do
def show_modal(js \\ %JS{}, id) when is_binary(id) do
js
|> JS.set_attribute({"data-state", "open"}, to: "##{id}")
|> JS.show(to: "##{id}", transition: {"", "", ""}, time: 150)
|> JS.show(to: "##{id}", transition: {"_", "_", "_"}, time: 150)
|> JS.add_class("overflow-hidden", to: "body")
|> JS.focus_first(to: "##{id}-content")
end

def hide_modal(js \\ %JS{}, id) do
js
|> JS.set_attribute({"data-state", "closed"}, to: "##{id}")
|> JS.hide(to: "##{id}", transition: {"", "", ""}, time: 150)
|> JS.hide(to: "##{id}", transition: {"_", "_", "_"}, time: 150)
|> JS.remove_class("overflow-hidden", to: "body")
|> JS.pop_focus()
end
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule SaladUI.MixProject do
def project do
[
app: :salad_ui,
version: "0.5.0",
version: "0.5.2",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -41,7 +41,7 @@ defmodule SaladUI.MixProject do
maintainers: ["Dung Nguyen"],
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/bluzky/salad_ui"},
files: ~w(lib assets .formatter.exs mix.exs README*)
files: ~w(lib assets/*.css .formatter.exs mix.exs README*)
]
end

Expand Down

0 comments on commit 9733c08

Please sign in to comment.