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 that opens DisplayView only handles width correctly once #2

Open
jchilde opened this issue Jun 13, 2019 · 5 comments
Open

Comments

@jchilde
Copy link

jchilde commented Jun 13, 2019

If you open a displayview the dialog works great. However, if you then close and reopen, then width reverts back to not working correctly.

@AJIXuMuK
Copy link
Owner

@jchilde could you please provide more details?

There was a similar issue pnp/sp-dev-fx-controls-react#303.
Could you please check if the issue is fixed?

@lvasiliou
Copy link

Having the same issue. Subsequent calls to show the iframedialog result to a tiny width, ignoring what was set

<IFrameDialog url={this.state.EditDialogUrl} hidden={this.state.EditDialogHidden} modalProps={{ isBlocking: true }} width={'800px'} height={'800px'} dialogContentProps={{ type: DialogType.close, showCloseButton: true }} onDismiss={this.dismissEditDialog}></IFrameDialog>

public editClicked = (item: IDocument) => (e) => { e.preventDefault(); let editUrl: string = this.props.context.pageContext.web.absoluteUrl + "/_layouts/15/listform.aspx?PageType=6&ListId=" + this.state.CurrentList.ID + "&ID=" + item.ID +"&IsDlg=1"; this.setState({ EditDialogHidden: false, EditDialogUrl: editUrl }); }

Second time editClicked is called, the dialog width isnt applied.

@AJIXuMuK
Copy link
Owner

hey @lvasiliou,

Here is the similar issue with the sample that worked for me as well as the author: #345
Please, let me know if it helps in your situation.

If not - could you please share the complete sample with us?

@lvasiliou
Copy link

hey @lvasiliou,

Here is the similar issue with the sample that worked for me as well as the author: #345
Please, let me know if it helps in your situation.

If not - could you please share the complete sample with us?

Yup that works, I was thinking "perhaps the component should be fully disposed if its not displayed" but you beat me to it

@ArndBrugman
Copy link

Seems to be related to the hidden parameter, which omho is a bit of overkill too. Rendering the dialog conditionally fixes it and has the same functionality the hidden parameter is trying to accomplish. Removing the hidden parameter will make sure the component is recreated and not re-used, this might impact performace a little, but as I see it, we will only use limited dialogs, so not really a big issue for user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants