I want to embed a widget and its value in a same markdown string. When the slider position is changed, the value jumps ahead but it is replaced with zero immediately. Is there a better way to accomplish this? It seems that plain HTML (without PlutoUI) works fine.
This is with
[c3e4b0f8] Pluto v0.12.16
[7f904dfe] PlutoUI v0.6.10
Here’s a MWE:
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
# ╔═╡ a93f8c70-364c-11eb-3b5a-07c9bcc8210d
using Pluto, PlutoUI
# ╔═╡ bda1cf52-364c-11eb-01c0-331194e02a5b
s = @bind a Slider(0.0:0.1:10.0);
# ╔═╡ d8e10c92-364c-11eb-2480-cbf8d763d77b
md"$a $s"
# ╔═╡ Cell order:
# ╠═a93f8c70-364c-11eb-3b5a-07c9bcc8210d
# ╠═bda1cf52-364c-11eb-01c0-331194e02a5b
# ╠═d8e10c92-364c-11eb-2480-cbf8d763d77b