Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[admin] dark mode #5511

Merged
merged 9 commits into from
Nov 15, 2023
Prev Previous commit
Next Next commit
Add a stimulus controller for closing details when clicking outside
  • Loading branch information
elia committed Nov 15, 2023
commit 5a22b144888ede24eb3e6385f372a3be878a019b
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<details class="relative w-full" aria-label="<%= t('.account') %>">
<details
data-controller="details-click-outside"
class="relative w-full"
aria-label="<%= t('.account') %>"
>
<summary
class="
flex gap-1.5
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Controller } from "@hotwired/stimulus"
import { useClickOutside } from "stimulus-use"

export default class extends Controller {
connect() {
useClickOutside(this)
}

clickOutside() {
this.element.removeAttribute("open")
}
}