Skip to content

Option for "Leave site?" warning #20347

Closed
@Ryan-pelo

Description

@Ryan-pelo

Feature Description

A few times I have been typing a long comment or post and accidently clicked a link or refreshed the page. Then all my work is gone and non-recoverable. I would appreciate having a "Leave Site?" dialogue box if I have unsaved content in a text box.

Screenshots

Screenshot 2022-07-12 140337

Activity

added
type/featureCompletely new functionality. Can only be merged if feature freeze is not active.
type/proposalThe new feature has not been accepted yet but needs to be discussed first.
on Jul 12, 2022
silverwind

silverwind commented on Jul 14, 2022

@silverwind
Member

There is already a warning via jquery.are-you-sure, but I'm not sure whether it will catch all changes, I think it only looks at stuff inside <form>.

Also, we really need to eliminate all cases of window.reload in JS. Might require new APIs to be added thought.

wxiaoguang

wxiaoguang commented on Mar 2, 2023

@wxiaoguang
Contributor

Some details & background:

Before SimpleMDE/EasyMDE, there is a global $.areYourSure confirm (using onbeforeunload) for comment textarea. Everything was just "fine".

However, after introducing SimpleMDE/EasyMDE, $.areYourSure doesn't work well with SimpleMDE/EasyMDE editor, so the situation became what you see now.

silverwind

silverwind commented on Mar 2, 2023

@silverwind
Member

Another reason to add to the list of like 30+ other issues on why we should remove EasyMDE and replace it with a textarea.

wxiaoguang

wxiaoguang commented on Mar 2, 2023

@wxiaoguang
Contributor

I could also agree to remove the EasyMDE if there is no strong objection from user side.

silverwind

silverwind commented on Mar 2, 2023

@silverwind
Member

Yes I think the majority of users is for it, see #10729.

wxiaoguang

wxiaoguang commented on Mar 2, 2023

@wxiaoguang
Contributor

Then let's do it?

silverwind

silverwind commented on Mar 2, 2023

@silverwind
Member

Yes, I think the approach in #15394 with the github toolbar is still ideal. If you have the capacity to do it, please go ahead, I'm happy to review.

lunny

lunny commented on Apr 3, 2023

@lunny
Member

Should be fixed by #23895

silverwind

silverwind commented on Apr 3, 2023

@silverwind
Member

Works now with #23876

Screenshot 2023-04-03 at 22 34 48

locked as resolved and limited conversation to collaborators on May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lunny@silverwind@wxiaoguang@Ryan-pelo

        Issue actions

          Option for "Leave site?" warning · Issue #20347 · go-gitea/gitea