let input = null;

export default function getInputSize(value) {
    if (!input) {
        input = document.createElement('div');
        input.className = 'input';
        input.style.display = 'inline-block';
        input.style.visibility = 'hidden';
        input.style.position = 'relative';
        input.style.top = '0';
        input.style.left = '100%';

        document.body.appendChild(input);
    }

    input.innerText = value;

    return input.getBoundingClientRect();
}

let input = null;

export default function getInputSize(value) {
    if (!input) {
        input = document.createElement('div');
        input.className = 'input';
        input.style.visibility = 'hidden';
        input.style.position = 'absolute';
        input.style.top = '-999px';
        input.style.left = '-999px';

        document.body.appendChild(input);
    }

    input.innerText = value;

    return input.getBoundingClientRect();
}

Improve input size helper function
Improve input size helper function

The input could affect layout of tapps