Skip to content

List line actions can trigger multiple events #164

@dsgraham

Description

@dsgraham

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions