You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If a transition is guarded via an 'in' property, the state that is referenced there cannot be addressed in the same way the 'target' is addressed. This isn't documented and also no good behaviour.
Expected Result
If the state in the transition that the machine must be 'in' is rerenced via a 'custom' id, it works, if it is referenced with a 'complete' path (including top level state 'name'), it also works, but not if it is referenced via relative path like it is usually done for 'target'.
Actual Result
There is no error, but the guard is just 'never' passed.
jbouecke
changed the title
the 'in' guard works only if the state is defined by a complete path or a 'custom' id but it should work alos with relative path
the 'in' guard works only if the state is defined by a complete path or a 'custom' id but it should work also with relative path
Jan 8, 2022
This behavior is changing in v5 to avoid confusing behavior, where there will be stateIn(...) guards that work like state.matches(...).
Additionally, for v4, in: ... guards are relative to the parent parallel state or with an ID. All state nodes have an ID which is the state node's path:
I understand that, but wouldn't it be nice to refer the states in the same way as you can refer target states?
If I get you right, the behaviour in v5 will be again working just with id's or complete path?
Description
If a transition is guarded via an 'in' property, the state that is referenced there cannot be addressed in the same way the 'target' is addressed. This isn't documented and also no good behaviour.
Expected Result
If the state in the transition that the machine must be 'in' is rerenced via a 'custom' id, it works, if it is referenced with a 'complete' path (including top level state 'name'), it also works, but not if it is referenced via relative path like it is usually done for 'target'.
Actual Result
There is no error, but the guard is just 'never' passed.
Reproduction
see the following machine definition:
Additional context
I stumbled accros this while trying to enhance the visualizer to not show forbidden transitions as active (see this pull request)
The text was updated successfully, but these errors were encountered: