Skip to content

Commit fa11110

Browse files
committed
Fix Waypoint in Firefox
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.
1 parent 8df96af commit fa11110

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/waypoint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ var Waypoint = React.createClass({
138138
render: function() {
139139
// We need an element that we can locate in the DOM to determine where it is
140140
// rendered relative to the top of its context.
141-
return React.createElement('span');
141+
return React.createElement('span', { style: { fontSize: 0 } });
142142
}
143143
});
144144

0 commit comments

Comments
 (0)