Skip to content
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

IFrameDialog "commitPopUp" typo causes popups with classic forms to not close after hitting save #433

Closed
JRRSG opened this issue Dec 9, 2019 · 3 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Milestone

Comments

@JRRSG
Copy link

JRRSG commented Dec 9, 2019

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version

Please specify what version of the library you are using: [ 1.15.0 ]

Expected / Desired Behavior / Question

When using the IFrameDialog control to render classic forms in a popup in SharePoint Online, the dialog popup should close after hitting Save or Cancel.

Observed Behavior

After the iframe is rendered containing the classic form, hitting Cancel triggers the event and the popup closes as expected. However, after hitting Save the event is not triggered and the popup remains open and the classic list view is shown.

After searching high and low for why cancel was working and save was not, I noticed that SharePoint uses different casings of "popup" for the commit and the cancel events.

The cancel function used in SharePoint is:
window.frameElement.cancelPopUp

The commit function is:
window.frameElement.commitPopup

commitPopup is typed as commitPopUp in the PnP control

Steps to Reproduce

-- Create an SPFx solution that renders a classic form in a popup dialog using the IFrameDialog control
-- Test the solution on a modern page
-- Open a classic form in an iframe popup and test the Cancel and Save events //only Cancel fires
-- Change "commitPopUp" to "commitPopup" in the PnP IFrameDialog control files and test the SPFx solution again //both Cancel and Save will fire as expected

This picture shows a snippet from SharePoint's sp.ui.dialog.debug.js file and I've circled the different casings of "popup" used by this.$0_0.cancelPopUp compared to this.$0_0.commitPopup
Annotation 2019-12-09 104602

This picture shows the current code used in IFrameDialogContent.tsx
Annotation 2019-12-09 121031

@ghost
Copy link

ghost commented Dec 9, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Dec 9, 2019
AJIXuMuK added a commit that referenced this issue Dec 11, 2019
@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue will be fixed in upcoming release. type:bug and removed Needs: Triage 🔍 labels Dec 11, 2019
@AJIXuMuK AJIXuMuK added this to the 1.16.0 milestone Dec 11, 2019
@AJIXuMuK
Copy link
Collaborator

Thank you @JRRSG for reporting this one!
The fix has been committed and is available in beta version.
Please, feel free to test the version.

@estruyf
Copy link
Member

estruyf commented Dec 16, 2019

Version 1.16.0 is out, this includes the fix for this issue.

@estruyf estruyf closed this as completed Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Projects
None yet
Development

No branches or pull requests

3 participants