Fixed issue #2818 - TimeAccounting modal dialog input not focused.

This commit is contained in:
Martin Edenhofer 2019-11-21 14:40:59 +01:00
parent 9478c49fcd
commit 2beb1b4506

View file

@ -618,7 +618,17 @@ class App.ControllerModal extends App.Controller
onShown: (e) =>
if @autoFocusOnFirstInput
@$('.form-group').first().find('input:not([disabled]):not([type="hidden"]):not(".btn"), select:not([disabled]), textarea:not([disabled])').first().focus()
# select generated form
form = @$('.form-group').first()
# if not exists, use whole @el
if !form.get(0)
form = @el
# focus first input, select or textarea
form.find('input:not([disabled]):not([type="hidden"]):not(".btn"), select:not([disabled]), textarea:not([disabled])').first().focus()
@initalFormParams = @formParams()
localOnClose: (e) =>