From f4916a981a93e53171efc2622bd22d49ea7af51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Tue, 23 Jun 2020 15:53:58 +0200 Subject: [PATCH] Fix `focus` deprecation warning --- app/assets/javascripts/legislation_annotatable.js | 2 +- app/views/legislation/annotations/_comments_box_form.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/legislation_annotatable.js b/app/assets/javascripts/legislation_annotatable.js index 1b0c91ca7..3959dc5eb 100644 --- a/app/assets/javascripts/legislation_annotatable.js +++ b/app/assets/javascripts/legislation_annotatable.js @@ -109,7 +109,7 @@ }); if ($("[data-legislation-open-phase]").data("legislation-open-phase") !== false) { App.LegislationAnnotatable.highlight("#7fff9a"); - $("#comments-box textarea").focus(); + $("#comments-box textarea").trigger("focus"); $("#new_legislation_annotation").on("ajax:complete", function(e, data) { if (data.status === 200) { App.LegislationAnnotatable.remove_highlight(); diff --git a/app/views/legislation/annotations/_comments_box_form.js.erb b/app/views/legislation/annotations/_comments_box_form.js.erb index fbfce4c33..f290aff2e 100644 --- a/app/views/legislation/annotations/_comments_box_form.js.erb +++ b/app/views/legislation/annotations/_comments_box_form.js.erb @@ -1,5 +1,5 @@ <% if comment.errors.any? %> $("#comments-box-<%= @annotation.id %> a.publish-comment").hide(); $("#js-comment-form-annotation-<%= annotation.id %>").toggle(); - $("#js-comment-form-annotation-<%= annotation.id %> textarea").focus(); + $("#js-comment-form-annotation-<%= annotation.id %> textarea").trigger("focus"); <% end %>