Skip to content

Commit d27e7cd

Browse files
authored
Disable dialog button focus (hestiacp#3350)
1 parent 3095aa6 commit d27e7cd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

web/js/events.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,14 @@ const VE = {
219219
},
220220
},
221221
create: function () {
222-
const buttonGroup = $(this).closest('.ui-dialog').find('.ui-dialog-buttonset');
223-
buttonGroup.find('button:first').addClass('button submit');
224-
buttonGroup.find('button:last').addClass('button button-secondary cancel');
222+
const buttons = $(this).dialog('widget').find('.ui-dialog-buttonpane button');
223+
buttons.first().addClass('button submit');
224+
buttons.last().addClass('button button-secondary cancel');
225+
},
226+
focus: function () {
227+
const buttons = $(this).dialog('widget').find('.ui-dialog-buttonpane button');
228+
// Disable default "focus first button" behavior
229+
buttons.first().blur();
225230
},
226231
};
227232

0 commit comments

Comments
 (0)