ViewModel trigger .on() callback never fires (Web runtime v2.32.2)
Hi im experimenting with using dynamic conten for rive files in web (using canvas). In my current work I have a button in rive that should get the button-text from the outside. And the hover and click interaction should be known to the webpage as well, so I can have a js change the cursor to a pointer if the rive element has a viewmodel-trigger that expose its changes to the webpage.
So, now I'm trying to observe ViewModel triggers using the Web runtime, but the callback never executes.
Setup:
@rive-app/canvas v2.32.2
ViewModel with trigger property TriggerUrl-2
Listener in Rive Editor configured to fire this trigger on Pointer Down
autoBind: true
Code:
const vm = riveInstance.defaultViewModel();
const vmi = vm.defaultInstance();
const trigger = vmi.trigger('TriggerUrl-2');
console.log('Trigger exists:', !!trigger); // ✅ true
console.log('Has .on():', typeof trigger.on); // ✅ "function"
trigger.on(() => {
console.log('Trigger fired!'); // ❌ Never executes
});
What works:
setTextRunValue() ✅
onStateChange receives state names ✅
Trigger object exists with .on() method ✅
What doesn't work:
Callback never fires when clicking the button
Question:
Am I missing something in the setup, or is this a known issue with ViewModel trigger observability in the Web runtime?