Slider component is not usable when the App is launched with `dioxus_native::launch(App);`
Problem
When the App is launched with dioxus_native::launch(App);, the Slider component can't be clicked and dragged, and just stays static. Also, the thumb is displayed a bit under the SliderThumb.
Steps To Reproduce
Steps to reproduce the behavior:
- Create a dioxus project with
dx newand use any sub-template you want - Add
dioxus_nativeto yourCargo.toml - Create a
Slidercomponent, you can do that simply by doingdx component add sliderand take the Demo component from the Dioxus Components page for example - in the
main()function, replace :
with :dioxus::launch(App);dioxus_native::launch(App); - Serve your app with
dx serve
Expected behavior
The Slider component should properly work when clicked and dragged when launching the app with dioxus_native
Screenshots
https://github.com/user-attachments/assets/8d5941f3-dcc0-45fb-bb33-3a88437790fa
Environment:
- Dioxus version: v0.7.0 & v0.7.1
- Rust version: 1.91.1
- OS info: EndeavourOS with KDE Plasma 6.5.3
- App platform: desktop
This is currently expected behavior because blitz doesn't support javascript. We should at least log a warning if eval is called inside of blitz about javascript support.
We may be able to support this in the future once we have a cross platform DOM API
Understood, thank you for your reply !
We may be able to support this in the future once we have a cross platform DOM API
Hopefully we can start supporting some of these things in the component library before we have cross-platform DOM API by conditionally compiling code. But we'll at least need some access to low-level DOM APIs in native to unblock this.