Issue
Sliders calculate click position incorrectly when NetLogo Web simulation runtime overflows. This issue requires the iframe itself to overflow, which does not happen on the www.netlogoweb.org/launch but happens on www.netlogoweb.org/web.
Diagnosis
The function getClientPosition in ReactiveCustomSlider uses viewport-space coordinates while getSliderStart and getSliderLength use document-space coordinates. Due to how www.netlogoweb.org/launch embeds the runtime simulation, those coordinate-spaces share the same basis and offset. This is not the case on beta.modelingcommons.org or when running www.netlogoweb.org/web in its own tab.
Recreate
- Open a model in
www.netlogoweb.org/web
- Go into authoring mode
- Add a slider and push it outside of the window bounds
- Return to interactive mode
- Scroll until you find the new slider
- Click or drag along the slider
Expected behavior: slider snaps to mouse position on click and follows mouse on drag
Actual behavior: slider snaps to incorrect position, often at the extremes or by some noticeable offset from the mouse position
Issue
Sliders calculate click position incorrectly when NetLogo Web simulation runtime overflows. This issue requires the
iframeitself to overflow, which does not happen on thewww.netlogoweb.org/launchbut happens onwww.netlogoweb.org/web.Diagnosis
The function
getClientPositioninReactiveCustomSlideruses viewport-space coordinates whilegetSliderStartandgetSliderLengthuse document-space coordinates. Due to howwww.netlogoweb.org/launchembeds the runtime simulation, those coordinate-spaces share the same basis and offset. This is not the case onbeta.modelingcommons.orgor when runningwww.netlogoweb.org/webin its own tab.Recreate
www.netlogoweb.org/webExpected behavior: slider snaps to mouse position on click and follows mouse on drag
Actual behavior: slider snaps to incorrect position, often at the extremes or by some noticeable offset from the mouse position