Stimulus Discourse

Controller called twice


Newbie here trying to solve a problem. I see a similar question has been asked; however mine is a bit different as I’m not using Turbolinks. My controller is causing two events when I create ‘tag’. Any advice would be great.

comments-container{ “data-controller”: “comments”}
= current_tenant.label_for_field(:comment).try(:pluralize)
%a.fa.fa-cloud-download.export-comments-btn{ title: “Export” }
%a.fa.fa-archive.archive-toggle-btn{ title: “View Comments Archives” }
%textarea.form-control{ name: “Content” , “data-target”: “comments.content” }
Enter a tag followed by the tab, enter, comma or semi-colon key
%div{ “data-target”: “comments.tagsContainer” }
%input.tags-input-input{ type: “text” , “data-action”: “keydown->comments#createTag” }
Users to notify:
%select{ type: “select” , “data-action”: “comments#notifiedUsers”}
= options_for_select(current_tenant.users.order(email: :asc).pluck(:email, :id).unshift([“Please Select a User”,nil]))
%button.btn.btn-info{ type: “submit” , “data-action”: “comments#submit”}
= “Post #{current_tenant.label_for_field(:comment)}”
.comment-search{ placeholder: “Search Comments” }
= render @comments