From ef15221882b3fc6ddc2b21bce03bc9e5526f7fe4 Mon Sep 17 00:00:00 2001 From: Tom Conner Date: Wed, 22 Nov 2023 11:28:19 -0500 Subject: [PATCH] scroll new forms into view (e.g. continue button) --- generator/static/js/register-form.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generator/static/js/register-form.js b/generator/static/js/register-form.js index f74b53c..7d30c0d 100644 --- a/generator/static/js/register-form.js +++ b/generator/static/js/register-form.js @@ -213,6 +213,7 @@ window.addEventListener("load", (event) => { stripeFrame.src = `/register?q=${lookup_code}`; stripeFrame.contentWindow.addEventListener('message', onStripeFrameMessage, false); stripeFrame.hidden = false; + stripeFrame.scrollIntoView(); } // dispatch messages from stripeFrame @@ -229,7 +230,6 @@ window.addEventListener("load", (event) => { } // Handle the message here - console.debug('Stripe message:', event.data); switch (event.data.m) { case 'frame_scrollIntoView': @@ -239,7 +239,8 @@ window.addEventListener("load", (event) => { //TODO height of frame default: - console.error('unhandled message:', event.data); + console.debug(`message from ${event.origin}:`); + console.debug(event.data); break; } }