acteng / atip

Active Travel Infrastructure Platform
https://acteng.github.io/atip/
Apache License 2.0
22 stars 4 forks source link

Sometimes edit geometry mode can break #218

Closed dabreegster closed 1 year ago

dabreegster commented 1 year ago

Possible repro: start with a blank map. Load a file. Click the 1st feature to open its form. Click edit geom. Click the feature again. The form opens, instead of editing the polygon.

Caught on tape:

https://github.com/acteng/atip/assets/1664407/0950ac45-95e4-4126-b3a6-ff541147dbf4

I wrote a Playwright test to repro this, but it... doesn't exhibit the bug. So I'm increasingly believing @Pete-Y-CS's theory that this is a race condition with click events bubbling and/or the state changes in the two modes conflicting.

dabreegster commented 1 year ago

This was fixed a few weeks ago... I remember understanding the problem at the time (one of the fixes for #228), can't offhand find it now. It involved handling an event without checking current mode first.