-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 confirmation dialog on leaving WebUI while composing #5616
Conversation
Currently, Back button and Back hotkey can cause leaving from WebUI, as well as browser's back button. Users may hit those buttons accidentally, and their composing text will be lost. So this prevents it by showing confirmation dialog from `onbeforeunload` event.
|
||
// Dummy import, to make sure that <Status /> ends up in the application bundle. | ||
// Without this it ends up in ~8 very commonly used bundles. | ||
import '../../components/status'; | ||
|
||
const messages = defineMessages({ | ||
beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your composing text will be lost by leaving from Mastodon.' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Your draft will be lost if you leave Mastodon" sounds better
Isn't the bigger problem when you click "reply" or something else that clears the text area? shouldn't we show the warning then? |
@nightpool Ah yes, definitely. I think it can be a different PR because it would have different warning text with our confirmation modal. |
Sounds good
…On Wed, Nov 8, 2017 at 11:05 PM unarist ***@***.***> wrote:
@nightpool <https://github.com/nightpool> Ah yes, definitely. I think it
can be a different PR because it would have different warning text with our
confirmation modal.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5616 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAORV2Un3_Eq0ur6FX-aFjZbCd-c1zNaks5s0noigaJpZM4QVEMV>
.
|
) * Show confirmation dialog on leaving WebUI while composing Currently, Back button and Back hotkey can cause leaving from WebUI, as well as browser's back button. Users may hit those buttons accidentally, and their composing text will be lost. So this prevents it by showing confirmation dialog from `onbeforeunload` event. * Fix message and comments
* yarn manage:translations * Add Japanese translation for mastodon#5087 * Add Japanese translation for mastodon#5616 * Add Japanese translation for mastodon#5746 * Add Japanese translation for mastodon#5750
Currently, Back button and Back hotkey can cause leaving from WebUI, as well as browser's back button. Users may hit those buttons accidentally, and their composing text will be lost.
So this prevents it by showing confirmation dialog from
onbeforeunload
event.Thoughts:
returnValue
is only used on Edge. So maybe we can put simple text or blank string.onbeforeunload
can also mitigate Remain in app UI when clicking back button on a column #946 Redirect to unexpected page #3515, but I don't think it's good because 1) this may not work on mobile and some cases 2) I think it should back to Getting Started or simply ignore instead of unwanted dialog.