15 ms·
This is so much more important than people realise. The same applies to things like: what happens if you click a button, but change your mind, move your cursor
by oneplane 4y ago
This is so much more important than people realise. The same applies to things like: what happens if you click a button, but change your mind, move your cursor off the button before you release?
This is a nuance that has to be implemented by the UI developer, otherwise you're essentially stuck in a multi-step process you cannot get out of, no matter how many steps you have left to change your mind about. This is mostly implemented in a bad way in custom non-native-UIs like browser JavaScript where a button mouse event might be scoped to a click regardless of when the mouse down event and the mouse up event happens.
Native elements have (usually trough decades of legacy development) this down to perfection (in my current OS at least), even here on HN where the "add comment" button really is just the native button, it works flawlessly. But as soon as someone tried to 're-implement' it, things go horribly wrong, and something that looks like a familiar UI element suddenly behaves completely wrong.
With so much time spent interacting with UI widgets, any time you have to take a moment and think about how some new thing might work differently from the millions of other times you have used it is just painful.
- Jensson 4y agoIt is a bit harder than that, some clicks you want to happen on mouse down, other clicks you want to happen on mouse up if the button was first primed with a mouse down. Exactly what you want to happen with one or the other is mostly about expectations, some things feels better one way others the other. For example, when you click a file you select it on mouse down, not on mouse up, selecting on mouse up just feels strange so it shouldn't behave like a button it should fire the action on mouse down instantly. Edit: Just tested in windows and realized that it switches between select on mouse down and select on mouse up depending on if you click on the text or if you click on the whitespace part of the file, whitespace it selects on up... Anyway, yeah, few people do this correctly, even Microsoft has many strange things.
- deleted 4y ago[deleted]
- wongarsu 4y ago> Just tested in windows and realized that it switches between select on mouse down and select on mouse up depending on if you click on the text or if you click on the whitespace part of the file, whitespace it selects on up This is because the drag action changes. In the whitespace part, if you do mouse-down, the file gains a faint selection. If you "commit" with a mouse-up, it's selected. But you can instead move the mouse, turning it into an area selection (you draw a square and everything in that square is selected on mouse-up). If you click on the text, the selection is committed right away on mouse-down. If you move your mouse after mouse-down, you start a drag-and-drop action; which you can in turn abort by dragging the file to its original position and doing mouse-up, leaving you with the selection. Few people could describe this if asked, but on an intuitive level it seems to work, and it follows the principle of giving you rich visual feedback and letting you back out of an unintended action (just like aborting a button click before the mouse-down)