-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
show warning on navigation if currently editing comment or title #32920
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
show warning on navigation if currently editing comment or title #32920
Conversation
d0726b6
to
86f75f0
Compare
86f75f0
to
228fec8
Compare
I think we only need to change the parent "div form" to a real |
I've replaced the custom logic with the There is still a bug though. If you click "cancel", the form is still marked as dirty. This leads to the warning on page leave. |
b4aceb5
to
e8a3f95
Compare
No worry, I will fix it |
e8a3f95
to
fa2dd37
Compare
So you are taking over the PR? I've got 2 ideas:
|
I will make some improvements in this PR, just a moment. |
Does 74f80d4 work for you? The idea is to use an "ignore-dirty" class (we already used it at other places) |
Hmm, I can see an easier solution without playing with the "ignore-dirty" class, we could just check whether the form is hidden. Will try it to see whether it could make the code clearer. Update: done in be12c62 |
Your changes are looking very decent. Feel free to rebase and clean up the commit history. Let me know, once you are ready. |
Also thank you very much for the initial idea and work, it indeed helps end users. 👍 I think it is ready and will vote my approval. |
(Oh by the way, no need to rebase or squash in a PR, the final merge (to main branch) will do a square merge to have a clear commit history 😄 ) |
Yeah, I wrote a really big issue and then refreshed. Aaaand pooooof, everything was gone. 😆 |
Need a follow up fix: Fix areYouSure confirm #32941 |
* giteaofficial/main: (62 commits) Fix repo avatar conflict (go-gitea#32958) [skip ci] Updated licenses and gitignores fix trailing comma not matched in the case of alphanumeric issue (go-gitea#32945) Add auto-expanding running actions step (go-gitea#30058) Fix go-gitea#32954 (go-gitea#32955) Use Alpine 3.21 for the docker images (go-gitea#32924) Refactor template & test related code (go-gitea#32938) Use primary as button color (go-gitea#32949) [skip ci] Updated translations via Crowdin Add action auto-scroll (go-gitea#30057) Fix locale (go-gitea#32937) Enable Typescript `strictFunctionTypes` (go-gitea#32911) Fix areYouSure confirm (go-gitea#32941) Update i18n.go - Language Picker (go-gitea#32933) Move some errors to their own sub packages (go-gitea#32880) Improve navbar: add "admin" tip, add "active" style (go-gitea#32927) Refactor db package and remove unnecessary `DumpTables` (go-gitea#32930) show warning on navigation if currently editing comment or title (go-gitea#32920) Refactor pprof labels and process desc (go-gitea#32909) [skip ci] Updated translations via Crowdin ...
This PR fixes the issue #32223
With this little event handler, I'm forcing the browser to show the popup, as it does with normal forms.