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

Calling close event using ForwardRef of IFrame #965

Closed
VikasITG opened this issue Jun 23, 2021 · 1 comment
Closed

Calling close event using ForwardRef of IFrame #965

VikasITG opened this issue Jun 23, 2021 · 1 comment

Comments

@VikasITG
Copy link

VikasITG commented Jun 23, 2021

#962

The above solution is not resolving my issue, I have tried two solution

  1. Used boolean useState when value set to false I have removed IFrame from page.
 {!IsHide ? (
                            <IframeResizer
                                forwardRef={iframeRef}
                                heightCalculationMethod="lowestElement"
                                src={theURL as string}
                                checkOrigin={false}
                                className="iFrameHeight"
                            />
                        ) : null}
        

3.With ForwardRef it showing following error

Uncaught (in promise) TypeError: ref.current.close is not a function

For both the cases IFrame close event is not triggered.

@davidjbradshaw
Copy link
Owner

Please see https://iframe-resizer.com/frameworks/react/ for working example

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

2 participants