diff --git a/web/src/open-dialog.js b/web/src/open-dialog.js index a32db7bb2..5e1da4f75 100644 --- a/web/src/open-dialog.js +++ b/web/src/open-dialog.js @@ -153,11 +153,6 @@ export class OpenDialog extends EventTarget { input.value = url; workarea.append(input); elements.url_input = input; - input.addEventListener('keyup', ({ key }) => { - if (key === 'Enter') { - confirm.click(); - } - }); input_id = makeUUID(); label = document.createElement('label'); diff --git a/web/src/utils.js b/web/src/utils.js index ce23b2419..2bcac158a 100644 --- a/web/src/utils.js +++ b/web/src/utils.js @@ -125,6 +125,12 @@ export function createDialogContainer(id) { confirm.textContent = 'OK'; buttons.append(confirm); + win.addEventListener('keyup', ({ key }) => { + if (key === 'Enter') { + confirm.click(); + } + }); + const bend = document.createElement('span'); bend.classList.add('dialog-buttons-end'); buttons.append(bend);