Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated knowl.js for MathJax compatibility of hidden content #2247

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

geoff-cox
Copy link

The following PR is based on the suggestions provided by MathJax.

Removed line 315, which previously called MathJax.typesetPromise() before the knowl's visibility was updated. MathJax could not accurately measure the dimensions of elements while they were still hidden (display: none).

Updated line 60 to delay the call to MathJax.typesetPromise() until after the knowl becomes visible, but before the unrolling animation begins. This ensures that MathJax has the correct layout context for typesetting, preventing layout shifts and improving the smoothness of the animation.

I verified that knowls containing mathematical content is rendered correctly without layout shifts and ensured that the unrolling animation remains smooth and that no visual glitches occur during the transition.

Removed line 315, which previously called MathJax.typesetPromise() before the knowl's visibility was updated. MathJax could not accurately measure the dimensions of elements while they were still hidden (display: none).

Updated line 60 to delay the call to MathJax.typesetPromise() until after the knowl becomes visible, but before the unrolling animation begins. This ensures that MathJax has the correct layout context for typesetting, preventing layout shifts and improving the smoothness of the animation.

I verified that knowls containing mathematical content are now rendered correctly without layout shifts and ensured that the unrolling animation remains smooth and that no visual glitches occur during the transition.
@rbeezer
Copy link
Collaborator

rbeezer commented Aug 12, 2024

Thanks, @geoff-cox! I was just going to catch-up and encourage you to do this.

I'll try to take it for a spin, but input from @davidfarmer and @bnmnetp would be very helpful.

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 12, 2024

Took this for a drive and it looks good. Cross-reference knowls with math seem fine. Turned on lots of born-hidden knowls for the sample article and things like a Parsons problem with math inside a born-hidden knowl seem to be fine as well. Would like to have @davidfarmer check-off before merging.

@rbeezer
Copy link
Collaborator

rbeezer commented Sep 20, 2024

Pinging @davidfarmer and @bnmnetp for input or check-off. Thanks.

@davidfarmer
Copy link
Contributor

Looks okay. Sorry it took so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants