Forum Discussion
Needing to delay Set Focus after a state change BUG?
I've been working on a small interaction where there are 2 choices. The choice they select fills the top box, and the choice they didn't select auto fills the bottom box.
After doing so, they can swap the boxes around if they think they made the wrong decision.
Each box is just a shape with 3 states. Normal, Choice 1, Choice 2.
When a state changes I've set focus to the top box to be read out.
The thing is the top box would always read the wrong state alt-text, while the bottom box would always read out the correct alt-text for its state
For example
TOP BOX is set to state Choice 2 (reads out Choice 1 alt text)
BOTTOM BOX is set to state Choice 1 (reads out Choice 1 alt text) as it should
And yes the Set Focus was always the last trigger in order of operations. So state would change and then set focus would occur.
What I have learnt today is that the top box is not reading the wrong state, it's reading the previous state it was on. So to fix this I've had to create a hidden shape that when the boxes are swapped, an invisible object moves along a motion path for half a second and after the motion path has ended it sets focus to the top box and now reads out the correct state alt-text.
I don't know if this is fixable, but I'd love to not have to create my own timer delay just to set focus on the correct state.
Related Content
- 11 months ago
- 11 months ago