We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c83e48d commit 22540eeCopy full SHA for 22540ee
src/Truncate.js
@@ -132,7 +132,10 @@ export default class Truncate extends Component {
132
return;
133
}
134
135
- const targetWidth = target.parentNode.getBoundingClientRect().width;
+ // Floor the result to deal with browser subpixel precision
136
+ const targetWidth = Math.floor(
137
+ target.parentNode.getBoundingClientRect().width
138
+ );
139
140
// Delay calculation until parent node is inserted to the document
141
// Mounting order in React is ChildComponent, ParentComponent
0 commit comments