This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Releases: Galooshi/happo
Releases · Galooshi/happo
v2.8.3
v2.8.2
v2.8.1
v2.8.0
v2.7.7
v2.7.6
v2.7.5
After making the change to include all DOM nodes in the snapshot (instead of using the returned node) led to it being a lot harder to control the width of the snapshot. If you use React, you probably use ReactDOM.render
to render the happo example into the DOM. This usually involves creating an anonymous div that you append to the <body>
. Without some clever css styling in order to make this anonymous div the right size, you'll end up with full-width snapshots. To fix that, we've added a getRootNodes
function that you can use to control what nodes are used to compute the bounding rectangle.
Here's an example for React:
happo.getRootNodes = function() {
return document.querySelectorAll('[data-reactroot]');
};
You can return a NodeList
or an Array
from this function.