Giter VIP home page Giter VIP logo

Comments (5)

tnrich avatar tnrich commented on June 20, 2024 1

@MatthewHerbst thanks for getting back to me and for the nice work on the malformed links ;)

I don't think it is possible to change the css of the stuff being printed once you're in the browser dialog. Say you're trying to size an svg to fit nicely on the print window, it would be nicer to do that in a fake preview mode where you can play with the css in the devtools as opposed to opening and closing the print preview dialog over and over as you tweak the css. Does that make sense?

Maybe there is already a way to get what I want but I couldn't find one.

from react-to-print.

MatthewHerbst avatar MatthewHerbst commented on June 20, 2024

What's wrong with the preview dialog the browser gives you?

from react-to-print.

MatthewHerbst avatar MatthewHerbst commented on June 20, 2024

Ah, got it. Hmm. Seems like this would be a good chance to investigate using React Portals, though that would require us forcing newer React 16 versions which I personally wouldn't love since my company is still on 15 😢 but maybe we could make it in a way where it just does a noop if you're still on a version that doesn't have portals?

from react-to-print.

tnrich avatar tnrich commented on June 20, 2024

@MatthewHerbst or we could just continue using the iframe approach? I think my codesandbox illustrates how that approach could work. It definitely needs some work to make it nicer.

from react-to-print.

MatthewHerbst avatar MatthewHerbst commented on June 20, 2024

That works too! Just been reading about all the shiny things in React 16, and, they are shiny! Once concern: assuming the iframe should work and not just be static content, will app JS continue to function normally in iframes in all scenarios? I think there are ways to set it up properly, just have to be careful. Here's an example on SO: https://stackoverflow.com/questions/34743264/how-to-set-iframe-content-of-a-react-component

from react-to-print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.