I'm currently investigating why the MathJax render block is giving me an incorrect height for the div. Here's the code snippet:
<div class="text-field" id='inner-text'>\(\sqrt{b^{a}\frac{\partial y}{\partial x}}\)</div>
Here's the associated CSS:
.text-field {
display: inline-block;
overflow: hidden;
max-width: 15em;
}
When executing the following JavaScript snippet:
MathJax.typeset();
let text = document.getElementById("inner-text");
console.log(text.clientHeight,
text.offsetHeight,
text.getBoundingClientRect().height,
window.getComputedStyle(text).getPropertyValue('height'));
The console outputs:
41 41 41.25 "41.25px"
However, upon inspection in the elements tab:
https://i.sstatic.net/wWhjD.png
The actual height doesn't match any of the height values retrieved via JS. What could be causing this discrepancy and how can I obtain an accurate height value?