Dynamic hug layout works in editor but not in web runtime
Hi everyone,
I’m running into a layout issue when using Rive in the web canvas runtime and would really appreciate some guidance.
I have built a UI slider in Rive where the number of dots is controlled via a ViewModel property (IndexTotal). Inside the Rive editor, everything works as expected: the dot list is generated dynamically, and the container uses Hug width, so the overall layout expands correctly depending on the number of dots.
Rive_Slider_Setup.mp4In the editor it works just fine, but implementing it into web has left me clueless.
I am setting my IndexTotal from JS on load. The internal layout (dots, arrows, spacing) works correctly. But the outer artboard size does not update based on the Hug layout. It seems like the artboard keeps its original width (the value before Hug), even though the content inside grows. As a result, the canvas somehow clips the content.
I cannot seem to figure out a solution to this…
Maybe ‘hug' is not to be used that way?
Or maybe someone knows a simple fix for it. If anyone has any idea of how this should work, that would be awesome! Thanks! 😊