Re:Buttons as Finite Automata
by falcolas on Thursday March 24, 2022 @10:45AM
(#30790584)
Right click locks you in the "press" state, just so you know.
[ Parent
| on HN ]
Re:Buttons as Finite Automata
by DaiPlusPlus on Thursday March 24, 2022 @10:58AM
(#30790786)
No repro here (Chrome 99 on Windows): right-clicking the button works the same as left-clicking it (yes, there's my browser's context-menu, but it doesn't seem to interfere with the webpage's logic at my end).
Re:Buttons as Finite Automata
by squeaky-clean on Thursday March 24, 2022 @01:29PM
(#30792923)
On Chrome on Mac I get the same, and right clicking outside the button makes it stick in the (idle, down) state, hovering makes it move between (hover, pressed) and (idle, down).
Still a crazy cool demo though. Having worked on ui for my hobby games, I always knew it was more complex than just onClick, but this makes me understand it perfectly. I'm probably going to implement a model based on this in my current project.
I can make it do this on Firefox on Ubuntu; the key is to hit Escape to dismiss the context menu, instead of clicking away. Closing it by clicking away makes it act correctly.
Safari on a mac. The context menu pulls up, but even when dismissed, it's still stuck in the "idle, down" state.
Re:Buttons as Finite Automata
by scndrycntct on Thursday March 24, 2022 @02:42PM
(#30793799)
Repro's on Chrome/Mac as well--I think it's a macOS issue.
Not sure why it seems MacOS related, but same thing here on mac (safari and firefox).
I added a `#button:active` style to see if it was actually leaving it activated after dismissing the context menu, but apparently no. Not sure what the cause is.