set autofocus attribute on form fields for better keyboard support (#640)
This commit is contained in:
@@ -252,6 +252,11 @@ $(function() {
|
||||
$modal.modal({ backdrop : false });
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// workaround for autofocus attribute, as the modal "steals" it
|
||||
$modal.on('shown.bs.modal', function () {
|
||||
$(this).find('input:visible:first').focus().delay(1000).focus();
|
||||
});
|
||||
|
||||
$modal.modal('show');
|
||||
|
||||
// the new form that was loaded via ajax
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"build/app.js": "./app.js?2adac3fa8d223ed843ed",
|
||||
"build/app.js": "./app.js?6b33d608a88c93cb8dbc",
|
||||
"build/app.css": "./app.css?d1c5aa3942706f7bffb181e234e112de",
|
||||
"build/images/blue@2x.png": "./images/blue@2x.png?2694acfd",
|
||||
"build/images/blue.png": "./images/blue.png?96f8a905",
|
||||
|
||||
@@ -52,6 +52,9 @@ class ActivityEditForm extends AbstractType
|
||||
// string - length 255
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'label.name',
|
||||
'attr' => [
|
||||
'autofocus' => 'autofocus'
|
||||
],
|
||||
])
|
||||
// text
|
||||
->add('comment', TextareaType::class, [
|
||||
|
||||
@@ -40,6 +40,9 @@ class CustomerEditForm extends AbstractType
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'label.name',
|
||||
'attr' => [
|
||||
'autofocus' => 'autofocus'
|
||||
],
|
||||
])
|
||||
->add('number', TextType::class, [
|
||||
'label' => 'label.number',
|
||||
|
||||
@@ -46,6 +46,9 @@ class ProjectEditForm extends AbstractType
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'label.name',
|
||||
'attr' => [
|
||||
'autofocus' => 'autofocus'
|
||||
],
|
||||
])
|
||||
->add('comment', TextareaType::class, [
|
||||
'label' => 'label.comment',
|
||||
|
||||
@@ -111,6 +111,9 @@ class TimesheetEditForm extends AbstractType
|
||||
'label' => 'label.begin',
|
||||
'model_timezone' => $timezone,
|
||||
'view_timezone' => $timezone,
|
||||
'attr' => [
|
||||
'autofocus' => 'autofocus',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,10 @@ class UserCreateType extends UserEditType
|
||||
$builder
|
||||
->add('username', null, [
|
||||
'label' => 'label.username',
|
||||
'required' => true
|
||||
'required' => true,
|
||||
'attr' => [
|
||||
'autofocus' => 'autofocus'
|
||||
],
|
||||
])
|
||||
->add('plainPassword', RepeatedType::class, [
|
||||
'required' => true,
|
||||
|
||||
Reference in New Issue
Block a user