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

Image duplication in IE #218

Closed
dtgreene opened this issue Feb 22, 2020 · 17 comments
Closed

Image duplication in IE #218

dtgreene opened this issue Feb 22, 2020 · 17 comments

Comments

@dtgreene
Copy link

dtgreene commented Feb 22, 2020

I'm having an issue with images duplicating once or twice when using this in IE. In FF and Chrome it prints as expected; a document with just a single image. But in IE, the result is multiple images stacked on the document. Other elements will render fine around it.

class Printable extends React.Component {
    render() {
        return (
            <div className="printable-wrapper">
                <img src={require('../media/logo.png')} alt=""/>
            </div>
        )
    }
}

This document comes out with two images stacked but I've seen it do three as well. Is there maybe a workaround or known reason for this happening?

edit: this was in IE 11

@MatthewHerbst
Copy link
Owner

Hello, thanks for the report. Could you by chance make a working codesandbox or similar showing the full code/problem? Thanks

@dtgreene
Copy link
Author

Sure thing.

https://codesandbox.io/s/react-to-print-multi-image-issue-in-ie-example-gpxg6

I don't think codesandbox works in IE but I pulled it up in Edge and it has the same issue it looks like. Thanks

@chrisphillers
Copy link

I am having this issue also.

@dioscarey
Copy link

I had the same issue but I was able to avoid this issue removing header images-> #236

@MatthewHerbst
Copy link
Owner

I'm unable to reproduce the Edge 80 using BrowserStack. I believe you all that this is happening, I'm just not able to reproduce it yet (meaning I can't vet any fixes for it). I've requested free access from them via their open source program to be able to test using IE (normally requires a paid plan).

@stranzhay
Copy link

stranzhay commented Apr 28, 2020

any update on this issue ? experiencing the same thing in IE in company production code. i see there is an open PR for the edge issue that seems to include a fix for IE as well.

@lantanios
Copy link

Both IE 11 and Edge 42 are pulling all the img tags that exist on the page (outside of the ref div) and showing them on print screen at the top of the page.

I'm using react-to-print 2.6.3

@MatthewHerbst
Copy link
Owner

I'm going to do my best to get #236 released with #239 this week, possibly this afternoon.

@MatthewHerbst
Copy link
Owner

MatthewHerbst commented Apr 30, 2020

I've published a new release, 2.7.0-beta.1 Could you please try it out and see if it fixes the problems?

@lantanios
Copy link

Hi. I tried the new beta and getting compilation error:

Failed to compile.

./node_modules/react-to-print/lib/index.js
Module not found: Can't resolve 'ReactDOM' in '***\node_modules\react-to-print\lib'

@stranzhay
Copy link

Hi. I tried the new beta and getting compilation error:

Failed to compile.

./node_modules/react-to-print/lib/index.js
Module not found: Can't resolve 'ReactDOM' in '***\node_modules\react-to-print\lib'

Receiving this error as well in my build.

@MatthewHerbst
Copy link
Owner

MatthewHerbst commented Apr 30, 2020

Oops, my mistake. That error is coming from this change, which I have reverted in 1.7.0-beta.2 which is now available. Sorry for that. It doesn't impact the local experience apparently which is why I didn't catch it while developing locally.

@MatthewHerbst
Copy link
Owner

MatthewHerbst commented Apr 30, 2020

Please let me know how 1.7.0-beta.2 works for you, thank you for working with me on this.

@lantanios
Copy link

1.7.0-beta.2 has solved the issue in both Edge and IE.
Thank you for quick response and solution!

@stranzhay
Copy link

Thanks for the quick solution! Pushed and tested the update and it works great.

@dioscarey
Copy link

@MatthewHerbst Awesome, thanks! That works, next week I'll do better tests, but apparently it works as expected great work!

@MatthewHerbst
Copy link
Owner

This is out of beta and published as 2.7.0. Glad this seems to be working for everyone, and thanks for working with me to get it fixed! Going to close this for now. Please feel free to comment and/or open a new issue if you find any problems.

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

Successfully merging a pull request may close this issue.

6 participants