Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function onLoadingDone() {
updateInputWidth(element);
}
onKeyUp={(event) => {
updateInputWidth(event.target);
if (onKeyUp) {
onKeyUp(event);
}
}}
placeholder={placeholder}
function onLoadingDone() {
updateInputWidth(element);
}
ref={(ref) => {
if (ref) {
updateInputWidth(ref);
updateInputWidthOnFontLoad(ref);
}
if (itemRef) {
itemRef(ref, name);
}
}}
required={required}
ref={(ref) => {
if (ref) {
updateInputWidth(ref);
updateInputWidthOnFontLoad(ref);
}
if (itemRef) {
itemRef(ref, name);
}
}}
required={required}
onKeyUp={(event) => {
updateInputWidth(event.target);
if (onKeyUp) {
onKeyUp(event);
}
}}
placeholder={placeholder}
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);