Skip to content

Commit

Permalink
Fix Waypoint in Firefox
Browse files Browse the repository at this point in the history
The span that Waypoint renders to the page is rendered differently in
Firefox than Chrome. In Chrome, it has a height of 0, whereas in Firefox
it has a height that matches its font-size. This caused height
calculations in our specs to be off by 16px in Firefox. Giving this
element a font-size of 0 resolves this issue.
  • Loading branch information
lencioni committed Jan 28, 2015
1 parent 8df96af commit fa11110
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/waypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var Waypoint = React.createClass({
render: function() {
// We need an element that we can locate in the DOM to determine where it is
// rendered relative to the top of its context.
return React.createElement('span');
return React.createElement('span', { style: { fontSize: 0 } });
}
});

Expand Down

0 comments on commit fa11110

Please sign in to comment.