diff --git a/Project.toml b/Project.toml index a9373660..ea6e8546 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlutoUI" uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" authors = ["Fons van der Plas "] -version = "0.7.53" +version = "0.7.54" [deps] AbstractPlutoDingetjes = "6e696c72-6542-2067-7265-42206c756150" diff --git a/src/Builtins.jl b/src/Builtins.jl index fb206d3f..3787b345 100644 --- a/src/Builtins.jl +++ b/src/Builtins.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.19.25 +# v0.19.31 using Markdown using InteractiveUtils @@ -189,9 +189,17 @@ begin const input_el = currentScript.previousElementSibling const output_el = currentScript.nextElementSibling const displays = $(string.(slider.values)) - - input_el.addEventListener("input", () => { + + let update_output = () => { output_el.value = displays[input_el.valueAsNumber - 1] + } + + input_el.addEventListener("input", update_output) + // We also poll for changes because the `input_el.value` can change from the outside, e.g. https://github.com/JuliaPluto/PlutoUI.jl/issues/277 + let id = setInterval(update_output, 200) + invalidation.then(() => { + clearInterval(id) + input_el.removeEventListener("input", update_output) })