No unsaved changes warning in Lightning

  • 1
  • Problem
  • Updated 9 months ago
  • Acknowledged
No unsaved changes warning in Lightning.  I think the model changes are being "activated" (the save button is highlighted) but I don't get the browser popup.  I do get it if I switch back to Classic.  No browser popup blocker.
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,284 Points 10k badge 2x thumb
Hi Allison,

Is the Skuid page exactly the same, and the only difference is that you've switched from Lightning to Classic? And, did you make the exact same changes to the page in both scenarios, and observed this difference in behavior?

Also, which version of Skuid are you working with?
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb

It's the exact same pages (across all pages) and exact same changes.  The only difference is Lightning vs. Classic.


We're on Skuid 11.0
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,284 Points 10k badge 2x thumb
How are you viewing the Skuid pages? In other words, are they being exposed via Console, Visualforce pages, Lightning app, iframe, or simply previewing the page via the Page Composer? I've just tried a simple test and in Lightning while simply previewing the page, I saw the warning. 
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb
Visualforce page
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,162 Points 10k badge 2x thumb
I've just tested a Skuid page in a Visualforce page, and am not able to reproduce the issue. Is your Visualforce page inside of a Lightning page, or a tab? Or can you show us how you've got this set up so that it exists within Lightning? 
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb
No, it's happening on both the standard page overrides and custom tab.  We don't have any inside of a lightning page
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,284 Points 10k badge 2x thumb
Hello Allison, we've been able to reproduce this issue. Specifically it looks to be happening only when a user is in Lightning Experience, and navigates away from a Skuid-on-Visualforce page, while inside a "Classic" Salesforce app. If the page has unsaved changes, the Skuid page is apparently not able to see that the user has navigated away in this specific scenario, and it may have to do with how Salesforce's Lightning Experience delivers Visualforce pages in iframes. 

We will update this post when a fix is available, and we appreciate your taking the time to help surface the issue!
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,284 Points 10k badge 2x thumb
Hi Allison. We spoke about this privately, but I wanted to close the loop for the community so I'm sharing our findings here too.

Our engineers have been corresponding with Salesforce Partner Support about this. Unfortunately, when a user navigates away from a page in Lightning, the "onbeforeunload" event is not triggered. This is because Salesforce has designed Lightning as a one-page experience, and content loads and unloads dynamically within a single URL. Salesforce has stated that this is therefore working as designed. When in Classic Salesforce, this "onbeforeunload" event is triggered by Salesforce, and that is the only way a Skuid page can know that the user has tried to navigate away from the current URL. 

We subsequently asked Salesforce if there is any other way for a Skuid page to be alerted that the user is about to navigate away, and at this time, there is not. The engineering team is still looking for other options available to make Skuid itself more aware of when a warning should be shown, but as far as warnings before navigating to a different URL (via closing the browser or using the browser's back button, for example), there are currently limitations in the Lightning platform that have tied our hands.