Re:Buttons as Finite Automata
by FabHK on Thursday March 24, 2022 @12:46PM
(#30792375)
It is useful because you don't want to fire when you click and hold outside the button, then enter the button area, then release. So, when you release inside the button, you must know whether you clicked inside or outside the button. Thus you need those states. I think.
[ Parent
| on HN ]
Re:Buttons as Finite Automata
by tonyarkles on Thursday March 24, 2022 @04:58PM
(#30795247)
If you imagine DOM elements as each having a separate FSM and if you consider the possibility of entry/exit actions on each state, "idle, down" in the bottom left could have an entry action that primes the system for drag & drop. Click down outside, release inside is exactly what D&D would have.