#bachir_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1217506123603771492
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
I'm sorry but your description doesn't give me much to go on. Can you start by explaining what Stripe product you are integrating?
Hi, sorry about that, didn't have much place : we are integrating Stripe Express Checkout
Okay so you are using the ECE https://docs.stripe.com/elements/express-checkout-element
And the issue is with the viewable space in the modal window?
Or that the modal doesn't autoscroll to the error content?
This is the behaviour when clicking, the view does not go to the errored input
This is what is expected (This time we click on the "Donate" button, which triggers the normal handleSubmit of the form)
I realize this might be an issue with react-hook-form, but since the issue only happens with ApplePay and not GooglePay, I thought you might have an idea
Okay, correct me if I'm wrong but that doesn't have to do with launching the Apple/Google pay modal, correct?
no, it is expected that the modal doesn't open in this case since the form validation failed (hence I do not call event.resolve in the onClick handler because of that)
Okay and what are you using for form validation (since that isn't part of the Express Checkout Element)?
we use react hook form lib, and I call this function https://react-hook-form.com/docs/useform/trigger in the onClick handler. trigger(undefined, { shouldFocus: true })
Okay so that scrolling behavior isn't something implemented by Stripe. I suspect you would need to call some function in your on('confirm') event handler to trigger the scrolling. https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#submit-the-payment
Okey so this means we would allow the applepay modal to open, then do the form validation in the onConfirm handler of the ECE ? Wouldn't that be less user friendly ?
Oh wait, sorry no that isn't were you would place the logic. You are right.
Your form validation appears to handle this correctly currently (except for the scrolling part). Is there a way you can hook into that logic and add the scolling?
At this point I'm just guessing since this isn't code Stripe owns
I tried all the tricks I could think of : using setFocus from react-hook-form to focus the errored input, calling the handleSubmit instead of trigger, window.setScroll etc... it just doesn't do ๐คท
In any case, it's not Stripe related if it's not a known issue on your side, I'll keep investigating, thanks for your help!
Happy to shed what ๐ก I can ๐
I hope you can get the behavior you are looking for ๐ค
thanks ๐