Closed Ephraim-Bryski closed 1 year ago
MathQuill calculates the size for the parens. When you use display: none
, the element has no size and the parens' heights cannot be calculated.
We have typically thrown the element offscreen, so that it will render properly. You would also need to dynamically apply and aria-styling for the field because you're not using display: none
.
.mq-hide {
width:auto !important;
height:auto !important;
line-height:normal !important;
overflow:hidden !important;
position:fixed !important;
left:-9999px !important;
/* opacity:0 !important; <-might be needed?, though we never have */
}
Thank you!
If the HTML element of a static math field first has its display set to none, and then its field's latex is set, the parentheses (or brackets) are not displayed when the element is displayed. In the sample code, when the user presses the button, the parentheses don't display.
Note that if the display is set to none after the latex is set, the problem is resolved. For my use case, though, I have several elements with static mathquill which are hidden by default but can be displayed on user clicks. Temporarily making the elements display before setting the latex and hiding it immediately after seems hacky, and might get pretty complicated.