diff --git a/Project.toml b/Project.toml index 4cf31c59..58c4a713 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.49" +version = "0.7.50" [deps] AbstractPlutoDingetjes = "6e696c72-6542-2067-7265-42206c756150" diff --git a/src/Builtins.jl b/src/Builtins.jl index 1b70e6e3..9208397f 100644 --- a/src/Builtins.jl +++ b/src/Builtins.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.19.14 +# v0.19.18 using Markdown using InteractiveUtils @@ -156,7 +156,7 @@ begin function Slider(values::AbstractVector{T}; default=missing, show_value=false, max_steps=1_000) where T new_values = downsample(values, max_steps) - Slider(values, (default === missing) ? first(new_values) : let + Slider(new_values, (default === missing) ? first(new_values) : let d = default d ∈ new_values ? convert(T, d) : closest(new_values, d) end, show_value) diff --git a/test/runtests.jl b/test/runtests.jl index d7481182..2486f911 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -276,10 +276,13 @@ transform(el, x) = AbstractPlutoDingetjes.Bonds.transform_value(el, x) max_downsample_time = 0.001 # seconds # this should take less than 0.1ms @test max_downsample_time >= @elapsed PlutoUI.BuiltinsNotebook.downsample(x3, 100) - - - + x4 = 1:9802439083 + el = Slider(x4; default=2, show_value=true) + + @test length(el.values) <= 1000 + @test default(el) == 1 + el = Scrubbable(60) @test default(el) === 60 el = Scrubbable(60.0)