Checkout: Fix language select width in modal (#4823)

This commit is contained in:
d11n
2023-03-28 13:12:47 +02:00
committed by GitHub
parent 22657b66d7
commit 08ff2f3173
2 changed files with 6 additions and 3 deletions

View File

@@ -179,8 +179,7 @@ section dl > div dd {
background: rgba(var(--btcpay-black-rgb), 0.85);
}
.checkout-modal h1,
.checkout-modal footer a:hover,
.checkout-modal #DefaultLang:hover {
.checkout-modal footer a:hover {
color: var(--btcpay-white);
}

View File

@@ -62,7 +62,11 @@ function updateLanguageSelect() {
$languageSelect.parentElement.appendChild(element);
const width = element.offsetWidth;
$languageSelect.parentElement.removeChild(element);
$languageSelect.style.setProperty('--text-width', `${width}px`);
if (width && width > 0) {
$languageSelect.style.setProperty('--text-width', `${width}px`);
} else { // in case of modal this might not be rendered properly yet
window.requestAnimationFrame(updateLanguageSelect);
}
}
function updateLanguage(lang) {