Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changeset comment text is lost when switching entity pages #4561

Open
dreua opened this issue Mar 5, 2024 · 6 comments · May be fixed by #4565 or #4563
Open

Changeset comment text is lost when switching entity pages #4561

dreua opened this issue Mar 5, 2024 · 6 comments · May be fixed by #4565 or #4563

Comments

@dreua
Copy link

dreua commented Mar 5, 2024

URL

https://www.openstreetmap.org/changeset/148222445?way_page=1

How to reproduce the issue?

  1. You need a changeset with multiple pages of changed enitties
  2. Write some text in the comment box
  3. Click on one of the numbers in order to see more of the changed entities
  4. Your comment is gone forever

Screenshot(s) or anything else?

This is very bad UX. I am very grateful to everyone who built openstreetmap.org as well as iD but I'll be even more grateful when this bug is fixed and I won't loose a comment ever again.

@HolgerJeromin
Copy link
Contributor

HolgerJeromin commented Mar 6, 2024

Dev hint to solve this (not for the user of the page): Add conditionally a beforeunload handler. But beware of this:

Important: the beforeunload event should only be used to alert the user of unsaved changes. Once those changes are saved, the event should be removed. It should never be added unconditionally to the page, as doing so can hurt performance in some cases.

https://developer.chrome.com/docs/web-platform/page-lifecycle-api#the_beforeunload_event

@dreua
Copy link
Author

dreua commented Mar 6, 2024

This was Firefox on Linux btw, haven't tried other browsers.

@dreua
Copy link
Author

dreua commented Mar 6, 2024

Ideally I'd say there isn't a reload at all, just load the data via JS and leave the text field alone? But a warning would be definitely better than nothing

@danieldegroot2
Copy link
Contributor

danieldegroot2 commented Mar 9, 2024

@AntonKhorev

This comment was marked as outdated.

@danieldegroot2

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants