Design/UX #4895

Edit Profile Confirmation Dialog

Added by Samantha Raddatz almost 6 years ago. Updated over 5 years ago.

Priority name:
Category name:
Public Portfolio
Target version:
Start date:
Due date:
% Done:


Estimated time:


When a user makes changes to their profile and tries to exit the page without saving their changes, the current confirmation dialog could be clearer. Screengrab of the current dialog attached.
I suggest changing it to something like "You have unsaved changes to your profile. Are you sure you want to leave this page?"

Related ticket #4209


#1 Updated by Boone Gorges almost 6 years ago

  • Assignee changed from Boone Gorges to Daniel Jones
  • Target version set to 1.10

Dan, I'm assigning this to you because you recently built a custom confirmation dialog, and I'd like to be sure that any new dialogs we add are similar. It may turn out that you need to modify BP's JS to prevent it from firing its own beforeunload event; we run a fork of it (wp-content/themes/bp-nelo/_inc/global.js) so feel free to make whatever changes are necessary.

#2 Updated by Daniel Jones over 5 years ago

I think the change over to CAC Advanced Profiles has broken the confirmation dialogue entirely - nothing stops me from closing the page after I make some edits. I think it's because right now global.js is monitoring the form with ID "profile-edit-form", but the CACAP edit form is called "cacap-edit-form", and I think some other elements would have to change too. Should I just delete it entirely from global.js and add to bp-nelo's custom.js? Or change the logic right in global.js? Either way I think it'll be very easy to adapt what I did here for this use case:

#3 Updated by Boone Gorges over 5 years ago

I don't think we need the old JS anymore, so whatever you want to do is fine. (our global.js is forked, so feel free to edit it directly if it's easier)

#4 Updated by Daniel Jones over 5 years ago

Great! So I've hooked up a dialog just like the one we used on the message canceling to the cancel button on the profile editing. However - you can't actually do all that much with the beforeunload event. All you can do is return a custom string for the browser to display, and even that isn't used by some browsers. Firefox, for example, doesn't care what you return, it shows its own message. For Chrome and others I use "You have unsaved changes to your profile" since they already add the "Are you sure you want to leave" part. Here's the commit:

Let me know if you think this works.

#5 Updated by Boone Gorges over 5 years ago

  • Status changed from New to Resolved

Thanks, Dan! I think the standard browser verbiage is fine - this is a de facto standard for every website. I'm going to mark this one resolved.

Also available in: Atom PDF