Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function updateInputWidthOnFontLoad(element) {
if (!document.fonts) {
return;
}
const font = getFontShorthand(element);
if (!font) {
return;
}
const isFontLoaded = document.fonts.check(font);
if (isFontLoaded) {
return;
}
function onLoadingDone() {
updateInputWidth(element);
}
document.fonts.addEventListener('loadingdone', onLoadingDone);
function updateInputWidthOnFontLoad(element) {
if (!document.fonts) {
return;
}
const font = getFontShorthand(element);
if (!font) {
return;
}
const isFontLoaded = document.fonts.check(font);
if (isFontLoaded) {
return;
}
function onLoadingDone() {
updateInputWidth(element);
}
document.fonts.addEventListener('loadingdone', onLoadingDone);