openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.36k stars 1.21k forks source link

Selection is easily lost when panning using click-lock mechanism of certain mouse drivers #8105

Closed tkansgar closed 2 years ago

tkansgar commented 3 years ago

Hi,

(just copied from https://github.com/openstreetmap/iD/issues/7826#issuecomment-712230444)

Each time, I move the whole map scene a little bit by pressing and dragging some point beyond any map object, the selection of the object recently selected (mostly some kind of highway / track) is lost. So I must reselect it after each map scene moving. Is it possible to preserve the selection in this case (like older Id versions did)?

BR tkansgar

quincylvania commented 3 years ago

@tkansgar This is the behavior I'm seeing:

  1. Select something
  2. Click and hold the map for a time
  3. The paste menu appears and the selection is cleared
  4. Drag the map and release the mouse
  5. The selection is still cleared

So the solution would be not to clear the selection, or at least to reselect after dragging the map.

tkansgar commented 3 years ago

Yes, that would be great! No matter, wether you don't clear the selection or you reselect it.

tkansgar commented 2 years ago

Hi @quincylvania, currently https://preview.ideditor.com/release/ isn't accessible (s.a. #9289). And this issue seems to be not resolved until now. Therefore I have difficulties to use iD currently. So I would be very grateful, if either this issue could be resolved or https://preview.ideditor.com/release/ could be accessible again. BR tkansgar

tkansgar commented 2 years ago

I have some proposals to resolve this issue:

One of these three solutions would be enough for me.

tkansgar commented 2 years ago

Hi, is there nobody, who can resolve this issue or make https://preview.ideditor.com/release/ accessible again?

tyrasd commented 2 years ago

Hi, is there nobody, who can resolve this issue or make https://preview.ideditor.com/release/ accessible again?

This is now available again, see https://github.com/openstreetmap/iD/issues/9289#issuecomment-1249301600

tkansgar commented 2 years ago

Many thanks @tyrasd! Works again.

tkansgar commented 2 years ago

@tyrasd: Is there still an older version, which doesn't automatically display the (unusable) popup menu when holding down the left mouse button a (very) short time? https://preview.ideditor.com/release/ didn't it, but now https://ideditor-release.netlify.app/ does. That popup menu is the cause of this issue (see the notes above).

tyrasd commented 2 years ago

You can try out older versions of iD on the following test page: https://id.raifer.tech/sotm-2022/ . But it won't help you much, I'm afraid, as these are limited to the development "test" OSM API, and don't modify the actual OSM database. This is for a good reason, as old versions of iD may contain bugs and use outdated data such as presets.


Regarding the bug you encountered: I can confirm the problem, but unfortunately it is not an "easy fix". Can you not, as a workaround until this is fixed, just try to move your mouse a bit quicker after pressing the left mouse button, to prevent that the context menu gets opened in the first place?

tyrasd commented 2 years ago

menu when holding down the left mouse button a (very) short time?

btw: what do you mean by a "short time" here? In my tests, it took about half a second for the context menu to open on long press. Is it a shorter time on your system?

tkansgar commented 2 years ago

You can try out older versions of iD on the following test page: https://id.raifer.tech/sotm-2022/ . But it won't help you much, I'm afraid, as these are limited to the development "test" OSM API, and don't modify the actual OSM database. This is for a good reason, as old versions of iD may contain bugs and use outdated data such as presets.

Of course, I use iD to modify the actual OSM database. So those versions won't help.

Regarding the bug you encountered: I can confirm the problem, but unfortunately it is not an "easy fix". Can you not, as a workaround until this is fixed, just try to move your mouse a bit quicker after pressing the left mouse button, to prevent that the context menu gets opened in the first place?

That I'm just trying. But it's working more badly than well for me, since I'm using the click lock feature of the mouse driver (as I wrote already in #7826). When pressing the left mouse button I have to wait about 0.1 or 0.2 seconds, until the mouse press is locked. Then I have only about more 0.1 or 0.2 seconds to begin the move operation, so that the menu doesn't appear and the selected object remains selected. In most cases this does not succeed. Additionally to use the click lock feature I have to release the mouse button after beginning the move operation. If I release it before the move operation, the selection also is lost. So preserving the selection when moving the map scene is very difficult for me. The best solution for me would be to be able to switch off the automatic appearance of the poup menu.

tyrasd commented 2 years ago

Thanks for giving the context. I've added this detail to the title of this issue.

Can you maybe explain why you are preferring to use the click-lock mechanism while mapping? I'm personally not using it and am currently struggling to understand why you could not "just" fall back to use the regular "holding the mouse button down the whole time while panning the map" method in situations where you want to preserve the selection…

tkansgar commented 2 years ago

Hi @tyrasd, yes I can. I'm using the mouse daily more than 10 hours, because I'm a professional software developer and use the PC also for my hobbies. And frequent mouse moving with holding down a button leaded to diseases like typewriter's cramp and mouse elbow (a variant of tennis elbow). One action to get rid of them was to use the click lock feature, so that I can release the button when dragging objects on the screen. Another action was to buy and use a vertical mouse, and last but not least I switch between right and left hand mice. The procedure pressing the button, waiting 0.2 or 0.3 seconds, releasing it, moving the mouse and finally clicking at the target position my finger does automatically. I don't need to concentrate on this. And when working with iD, I do it multiple hundred times to pan the map. But losing the selection nearly each time is very annoying.

tkansgar commented 2 years ago

Hi @tyrasd, can you say, whether and when this issue will be fixed?

tyrasd commented 2 years ago

My current idea is to add a setting to disable the long-click behavior in the next version, which is scheduled to be released in a few weeks (maybe towards the end of the month or so).

tkansgar commented 2 years ago

OK, but what do you mean by "to disable the long-click behavior"? I hope, you will disable the appearance of the popup menu (and preserve the current selection) then. And not disable the possibility to pan the map scene by using the click lock feature!

tyrasd commented 2 years ago

Sorry, I should have been more precise: I meant that the setting would disable the appearance of the menu on long-click.

1ec5 commented 2 years ago

If I’m not mistaken, the long-click behavior was originally added to support touchscreen devices – it’s the only way to access the context menu when using a stylus, for example. Perhaps there’s a way to detect touchscreen devices and only enable the setting by default in that case? (It’s similar to a behavior that used to be common on the Mac until about 2005.)

tyrasd commented 2 years ago

the long-click behavior was originally added to support touchscreen devices

That's right (see https://github.com/openstreetmap/iD/issues/7577#issuecomment-626377634)

I've given this a second look and found an actually pretty simple way to only open the context menu on long presses of non-mouse devices (i.e. touch or stylus users). Mouse users who cannot use a right click to open the context menu (for whatever reason) can still fall back to using the menu key or long pressing the space bar.

@tkansgar can you please confirm that the development version on https://ideditor.netlify.app/ now works for your use case?

tkansgar commented 2 years ago

@tyrasd: Perfect for me! I hope, no one else will miss the automatically displayed menu now.