Skip to content

addable functionality #10

Description

@jkburges

I have been successful in getting the "add" link to show, as in the preload example, but I am not sure how to hook up an event listener when it's clicked. Is there are more complete example?

If I add an event listener as below, I can see that the multiselect-addable event is firing, I'm just not sure what to do with it

export default class extends Controller {
  connect() {
    document.addEventListener("multiselect-addable", (event) => {
      console.log("Multiselect addable event triggered", event);
    });
  }

  ...
}

compared to say multiselect-added; I was able to hook my controller up to that event like data-action="multiselect-added->my-controller#onAdded, but cannot get something similar to work for multiselect-addable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions