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

List line actions can trigger multiple events #164

Open
dsgraham opened this issue May 28, 2019 · 0 comments
Open

List line actions can trigger multiple events #164

dsgraham opened this issue May 28, 2019 · 0 comments

Comments

@dsgraham
Copy link
Collaborator

If you have a list line with a click event and then an action on that line with a different event, multiple actions can be triggered. For example:

list do
  things.each do |thing|
    line do
      text thing.name
      event :click do
        hide :this_content_block
        show :some_other_block
      end
      actions do
        switch name: :active, value: true, off_value: false, checked: thing.active do
          event :change do
            posts update_thing_path, thing_id: thing.id
          end
        end
      end
    end
  end
end

Clicking the switch on a line will cause the post action to fire, but also the line's click event actions. Changing the switch's event to click instead of change makes it work as expected; the post fires, the hide/show does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant