Page MenuHomePhabricator

User is not asked to confirm before leaving page with unsaved edits in Depicts or Captions fields
Closed, ResolvedPublicBUG REPORT

Description

At some previous point (I can't find the exact commit now, unfortunately), if the user entered text into one of the input widgets for Depicts or Captions on the File Page that had not been published, they would be prompted to confirm that they want to leave the page.

This worked the same as it did for normal wikitext pages – a native brower alert would appear if the user attempted to navigate to a new location. Below is a screenshot of the confirmation alert on a normal wikitext page for comparison.

Screen Shot 2019-03-27 at 2.38.42 PM.png (1×2 px, 453 KB)

The same behavior should happen if the user has entered text in the Depicts or Captions inputs and attempts to navigate away, but this is not currently the case. Instead, they are immediately taken to the new page.

Steps to reproduce:

  1. Go to a file page
  2. Toggle the Captions or Depicts panel into edit mode
  3. Enter some text into the input without clicking "Publish Changes"
  4. Attempt to navigate to another page.

The navigation will happen immediately, instead of showing the alert.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Ramsey-WMF claimed this task.
Ramsey-WMF subscribed.

This looks like a duplicate of T219197 unless I'm missing something. @egardner, unless there's something specific about this particular ticket, I'll close it.

@Ramsey-WMF Uh oh. You are right. The work I completed for that ticket was to make sure we prompt for discarding changes from hitting 'cancel' button. I must have misinterpreted the ticket or our conversation. You can see that in the work and I did and my questions about the text. The issue described in that ticket was never occurring for me locally at at that time (or James either it looks like) and the default browser alert was opening fine.

Correct me if I'm wrong @egardner but my understanding is now both of us are seeing it occur and not occur randomly. Which is probably what was happening before; I just didn't experience it. I can look into this more and bring this ticket back to to do. @Ramsey-WMF do you want me to remove the confirm changes alert then?