#dfabulich_code
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/1316936517612208218
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, will be here after a MTG
Hi there, are you using an embeded Checkout?
I don't see that z-index. Looking forward to your URL
To repro, go to https://www.choiceofgames.com/beta/broadsides/
It's secured behind basic authentication, username "beta" password "yardarm"
Click "Buy It Now"
Login as stripe@choiceofgames.com password stripe
Select payment method "Card"
Use the "Payment requires authentication" card 4000002500003155
Expected: The 3D Secure popup should appear
Actual: The background darkens a little extra; the 3D Secure popup is behind the <dialog>.
As for the z-index, run this in the Dev Tools console:
document.querySelector("iframe[name='embedded-checkout-modals']").parentElement
You'll see that Stripe added this element:
<div tabindex=β"-1" style=β"display:β block !important;β position:β fixed !important;β z-index:β 2147483647 !important;β inset:β 0px !important;β margin:β 0px !important;β padding:β 0px !important;β visibility:β hidden !important;β opacity:β 0 !important;β">β<iframe name=β"embedded-checkout-modals" allow=β"publickey-credentials-get *" src=β"https:β/β/βjs.stripe.com/βv3/βembedded-checkout-modal-bbbdd5ee64c3ba852a522098d9f7dc69c3a5d49f.html" tabindex=β"-1" style=β"position:β absolute !important;β left:β 0px !important;β top:β 0px !important;β height:β 100% !important;β width:β 100% !important;β border:β none !important;β">ββ¦β</iframe>β</div>β
Note the z-index: 2147483647. It's quite high, but nothing can be as high as a <dialog>.
I see. Not sure if this is related but can you share how you initialized this <dialog>?
Here's code copied and pasted from ui.js linked from this page
window.Stripe(window.stripeKey).initEmbeddedCheckout({fetchClientSecret, onComplete: handleComplete}).then(function (result) {
checkout = result;
var dialog = document.createElement("dialog");
dialog.setAttribute("id", "checkoutDialog");
var closeButton = document.createElement("button");
closeButton.innerHTML = "X";
closeButton.addEventListener("click", function () {
checkout.destroy();
dialog.remove();
})
closeButton.setAttribute("class", "close");
dialog.appendChild(closeButton);
var checkoutDiv = document.createElement("div");
checkoutDiv.setAttribute("id", "checkout");
dialog.appendChild(checkoutDiv);
dialog.addEventListener("click", function(e) {
if (e.target === this) {
checkout.destroy();
this.remove();
}
})
document.body.appendChild(dialog);
dialog.showModal();
checkout.mount(document.getElementById('checkout'));
}).catch(function (e) {
console.error(e);
return asyncAlert("Sorry, we weren't able to initiate payment. (Your " +
"network connection may be down.) Please refresh the page and try again, or contact " +
"support@choiceofgames.com for assistance.");
});
}
There's not a lot of magic here; the magic is in the <dialog> element itself, which appears in the "top layer." https://developer.mozilla.org/en-US/docs/Glossary/Top_layer
hmm
Hi @keen yew I'm taking over this thread, let me take a look