Skip to content

Commit

Permalink
Correct rect in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 23, 2023
1 parent 9d84fd6 commit 83119aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dom/src/dom/get-rectangle-from-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function getRectangleFromRange( range ) {
// by adding a temporary text node with zero-width space to the range.
//
// See: https://stackoverflow.com/a/6847328/995445
if ( ! rect ) {
if ( ! rect || rect.height === 0 ) {
assertIsDefined( ownerDocument, 'ownerDocument' );
const padNode = ownerDocument.createTextNode( '\u200b' );
// Do not modify the live range.
Expand Down

0 comments on commit 83119aa

Please sign in to comment.