fix: autofocus reject SR dialog input focus to "Yes" button (#2083)

This commit is contained in:
Danny Brown authored and GitHub committed 2020-10-05 21:43:12 -04:00
1 parent 380acc1331
commit 6c40f581a6
3 files changed
+27 -14

No files matched your search

@@ -443,9 +443,19 @@ function _mapDisplaySets(
),
actions: [
{ id: 'cancel', text: 'Cancel', type: 'secondary' },
{ id: 'yes', text: 'Yes', type: 'primary' },
{
id: 'yes',
text: 'Yes',
type: 'primary',
classes: ['reject-yes-button'],
},
],
onClose: () => UIDialogService.dismiss({ id: 'ds-reject-sr' }),
onShow: () => {
const yesButton = document.querySelector('.reject-yes-button');
yesButton.focus();
},
onSubmit: async ({ action }) => {
switch (action.id) {
case 'yes':