Sp-dev-docs: `Dialog.alert` doesn't work in Application Customizer tested on modern page

Created on 12 Apr 2018  路  4Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Alert dialog box is displayed on the screen.

Observed Behavior

No dialog box is displayed on the screen. No errors in the console.

Steps to Reproduce

  1. Create new SharePoint Framework project using generator v1.4.1
  2. Create new solution using the latest bits (for use with SPO only)
  3. Add new extension
  4. Add Application Customizer, use default values for name and description
  5. Run gulp serve, copy the query string parameters and add them to a modern page URL in your tenant
  6. application customizer is loaded properly, and you can step through its code, but the alert is not displayed.
spfx-general tracked bug-confirmed

Most helpful comment

This actually works if the code has been deployed and hosted from CDN - but the issue is only there on modern pages if you do debug of extension with Dialog code from localhost. So - luckily not impacting any existing extensions out there, but impacting obviously development time experience as you cannot test the Dialog functionality on modern pages until you have deployed your solution to app catalog. Absolutely something we need to investigate on engineering side still.

All 4 comments

Can you @waldekmastykarz confirm that this works if you go to a list or library, but does not work on modern pages? - This is what I noticed with initial verification, just looking for confirmation of the behavior also from your tenant. Thx.

Correct: the alert shows as expected on list pages, but doesn't show on modern pages.

This actually works if the code has been deployed and hosted from CDN - but the issue is only there on modern pages if you do debug of extension with Dialog code from localhost. So - luckily not impacting any existing extensions out there, but impacting obviously development time experience as you cannot test the Dialog functionality on modern pages until you have deployed your solution to app catalog. Absolutely something we need to investigate on engineering side still.

Based on my testing, once the application customizer is deployed via app catalog, it loads the alert dialog on SPO mobile app the first time you access the site. For the alert to show again, i am having to kill and reload the app. Is this a known behavior or am i missing something? Any workarounds?

Was this page helpful?
0 / 5 - 0 ratings