      const caretEle = document.createElement('span');
                caretEle.innerHTML = '&nbsp;';
        
                mirroredEle.innerHTML = '';
                mirroredEle.append(pre, caretEle, post);
        
                const rect = caretEle.getBoundingClientRect();
                const toolbarRect = toolbarEle.getBoundingClientRect();
                const left = (textarea.clientWidth - toolbarRect.width) / 2;
                const top = rect.top + textarea.scrollTop - toolbarRect.height 