Skip to content

Commit

Permalink
Update to use current state for checks (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
hopsoft committed May 21, 2024
1 parent fdd236e commit 194ffa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/commands/turbo_boost/elements/toggle_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ def show

def hide
validate_element!
state[element.aria.controls] = false

if element.remember?
state[element.aria.controls] = false
else
state.now[element.aria.controls] = false
end

morph id: element.morphs, html: render(element.render_options)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def target_tag(
end

def target_expanded?(dom_id)
!!controller_pack.state[dom_id]
!!controller_pack.state.current[dom_id]
end

def target_collapsed?(dom_id)
Expand Down

0 comments on commit 194ffa2

Please sign in to comment.