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

Updating a variable interpolated into a MathJax equation scrolls notebook #535

Closed
mossr opened this issue Oct 6, 2020 · 0 comments · Fixed by #582
Closed

Updating a variable interpolated into a MathJax equation scrolls notebook #535

mossr opened this issue Oct 6, 2020 · 0 comments · Fixed by #582
Labels
frontend Concerning the HTML editor

Comments

@mossr
Copy link
Contributor

mossr commented Oct 6, 2020

When string interpolating a variable into a MathJax equation in Markdown, whenever the variable is changed (thus updating the MathJax) the notebook window scrolls up one tick.

Notes:

  • Only happens when there is other cells below
  • Only happens within MathJax, normal string interpolation in Markdown does not scroll
  • Not specific to @bind, bug is also present when just modifying a variable in a cell (@bind is just easy to play around with it)

Here's a MWE:

### A Pluto.jl notebook ###
# v0.11.14

using Markdown
using InteractiveUtils

# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
    quote
        local el = $(esc(element))
        global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
        el
    end
end

# ╔═╡ 6186e0a0-0766-11eb-36f8-715ffb9066ad
using PlutoUI

# ╔═╡ 62670770-0766-11eb-2c40-455dc1f787d6
HTML("<br>"^60)

# ╔═╡ 6e3f4170-0766-11eb-01c6-6bae72fb6523
@bind θ Slider(1:10)

# ╔═╡ 51082900-0766-11eb-2ffb-6d992bea4550
Markdown.parse("\$\$\\theta = \$\$")

# ╔═╡ 7fbdb5d0-0766-11eb-2c65-e75b8fdc987f
HTML("<br>"^60)

# ╔═╡ Cell order:
# ╠═6186e0a0-0766-11eb-36f8-715ffb9066ad
# ╠═62670770-0766-11eb-2c40-455dc1f787d6
# ╠═51082900-0766-11eb-2ffb-6d992bea4550
# ╠═6e3f4170-0766-11eb-01c6-6bae72fb6523
# ╠═7fbdb5d0-0766-11eb-2c65-e75b8fdc987f
@fonsp fonsp added the frontend Concerning the HTML editor label Oct 14, 2020
@fonsp fonsp linked a pull request Oct 17, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants