handle focus during and after upload

This commit is contained in:
Christophe Robillard 2021-03-09 18:56:57 +01:00
parent 43039d1755
commit df3bd3a1d2
3 changed files with 9 additions and 0 deletions

View file

@ -79,6 +79,12 @@ module ApplicationHelper
# rubocop:enable Rails/OutputSafety
end
def focus_element(selector)
# rubocop:disable Rails/OutputSafety
raw("document.querySelector('#{selector}').focus();")
# rubocop:enable Rails/OutputSafety
end
def disable_element(selector)
# rubocop:disable Rails/OutputSafety
raw("document.querySelector('#{selector}').disabled = true;")