From 9ef781dacbdae40c1a60a82b4ccf765e8869ca9b Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 30 Jan 2025 15:27:15 -0600 Subject: [PATCH] Submit comments with command or control + enter --- app/views/comments/_new.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/comments/_new.html.erb b/app/views/comments/_new.html.erb index a02562816..87e50e99f 100644 --- a/app/views/comments/_new.html.erb +++ b/app/views/comments/_new.html.erb @@ -1,7 +1,8 @@
- <%= form_with model: Comment.new, url: bucket_bubble_comments_path(bubble.bucket, bubble), class: "flex flex-column gap full-width", data: { controller: "form", action: "keydown.meta+enter->form#submit, keydown.esc->form#cancel:stop" } do |form| %> + <%= form_with model: Comment.new, url: bucket_bubble_comments_path(bubble.bucket, bubble), class: "flex flex-column gap full-width", + data: { controller: "form", action: "keydown.ctrl+enter->form#submit:prevent, keydown.meta+enter->form#submit:prevent, keydown.esc->form#cancel:stop" } do |form| %> <%= form.markdown_area :body, class: "input comment__input", required: true, placeholder: new_comment_placeholder(bubble) %> <%= form.button class: "comment__submit btn btn--reversed flex-item-justify-end txt-small" do %> <%= image_tag "check.svg", aria: { hidden: "true" }, size: 24 %>