js: consider select/textarea when setting focus on first dialog field (#68275)

This commit is contained in:
Frédéric Péters 2022-08-19 07:27:30 +02:00
parent dea0b0552d
commit ba02d038f7
1 changed files with 3 additions and 2 deletions

View File

@ -250,8 +250,9 @@ var gadjo_js = gadjo_js || {};
$content.dialog('option', 'buttons', buttons);
/* focus initial input field */
if ($form.find('input:visible').length) {
$form.find('input:visible')[0].focus();
var $form_fields = $form.find('input:visible, textarea:visible, select:visible');
if ($form_fields.length) {
$form_fields[0].focus();
}
/* if received content was in json, apply jQuery Form plugin on it */