question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preventing some elements from being rendering

See original GitHub issue

Is it possible to prevent a few elements from being rendered? I’d like to renderer the entire page (document.body) except for a few specific divs, which are there to help the user take the screenshot. I tried to use the ignoreElements option, but it seems to ignore all elements of a type, which is not really what I want.

I was checking http://experiments.hertzen.com/jsfeedback/ and they seem to do what I want. As far as I can tell, they have modified html2canvas.js in order to do so. It would be interesting if this feature existed in the original code.

Thanks a lot.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
junibrosascommented, Jun 2, 2017

ALL HAIL! I just found “data-html2canvas-ignore” to ignore element from rendering. It saved my career. Thanks!

7reactions
niklasvhcommented, Oct 9, 2012

Setting the element attribute data-html2canvas-ignore="true" should exclude it from rendering.

edit: infact, not sure whether I pushed that change to this repo yet or not. You could always grab the html2canvas.js copy from the feedback.js repo for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent a component from rendering ? - GeeksforGeeks
When UI is designed using React, we come across a situation when components are to be rendered on the screen based upon some...
Read more >
5 Ways to Avoid React Component Re-Renderings
In this article, I have discussed 5 different methods to prevent unnecessary re-rendering in React components. Most of these solutions capitalize caching, and ......
Read more >
How to elegantly prevent certain elements being rendered on ...
So I want to prevent certain elements (e.g. ads banners) which I know their html/css properties, for example, they will have a class...
Read more >
How to stop re-rendering lists in React? - Alex Sidorenko
Components always re-render. First, let's simplify our example by removing all props from the Item . We will still update the parent state...
Read more >
Optimizing React performance by preventing unnecessary re ...
Only re-rendering React components when necessary can make app your faster. This article explains how to reduce re-renders and avoid common ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found