File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -507,7 +507,10 @@ const Selection = Module({
507507 getSelectionBounds ( ) {
508508 const currentRange = this . getCurrentRange ( ) ;
509509 const rangeRects = currentRange ? currentRange . getClientRects ( ) : [ ] ;
510- const rangeBoundingClientRect = currentRange ? currentRange . getBoundingClientRect ( ) : null ;
510+ // NB: This seems to be unnecessary. It's used later for logic that is causing incorrect toolbar alignment.
511+ // Have commented out in case this is actually required for something else.
512+ // - Fred
513+ // const rangeBoundingClientRect = currentRange ? currentRange.getBoundingClientRect() : null;
511514
512515 let selectionBounds = {
513516 top : null ,
@@ -542,10 +545,15 @@ const Selection = Module({
542545 } ;
543546
544547 const setInitialBoundary = function ( rangeRect ) {
545- if ( rangeBoundingClientRect ) {
546- selectionBounds . initialLeft = rangeBoundingClientRect . left ;
547- selectionBounds . initialWidth = rangeBoundingClientRect . width ;
548- } else if ( rangeRect . top === selectionBounds . top ) {
548+ // NB: I have commented this out because it is causing inaccurate toolbar alignment.
549+ // I am leaving it here for now in case it was actually meant for something that I
550+ // can't recall right now.
551+ // - Fred
552+ // if (rangeBoundingClientRect) {
553+ // selectionBounds.initialLeft = rangeBoundingClientRect.left;
554+ // selectionBounds.initialWidth = rangeBoundingClientRect.width;
555+ // } else
556+ if ( rangeRect . top === selectionBounds . top ) {
549557 if ( selectionBounds . initialLeft === null ) {
550558 selectionBounds . initialLeft = rangeRect . left ;
551559 } else {
You can’t perform that action at this time.
0 commit comments