Skip to content

Commit

Permalink
11.0.4: * [Interactions/Website] In a interaction.website form `tex…
Browse files Browse the repository at this point in the history
…t:` element, pressing `<Enter>` now submits the form using the first `continue:` button. Previously this only worked if there was a single continue button, and its `value:` wasn't sent.
  • Loading branch information
jstanden committed Feb 7, 2025
1 parent fbdd593 commit 957ae85
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
let $popup = $prompt.closest('.cerb-interaction-popup');
// If we have a continue button
if(1 === $popup.querySelectorAll('.cerb-interaction-popup--form-elements-continue').length) {
$popup.dispatchEvent($$.createEvent('cerb-interaction-event--submit'));
let $submits = $popup.querySelectorAll('.cerb-interaction-popup--form-elements-continue');
// If we have multiple submits, click the first one when pressing enter
if($submits.length) {
$submits[0].dispatchEvent(
new MouseEvent("click", { "view": window, "bubbles": true, "cancelable": false })
);
}
}
});
Expand Down

0 comments on commit 957ae85

Please sign in to comment.