Skip to content

Commit

Permalink
Revert "Writing flow: fix triple click inside text blocks (#64928)"
Browse files Browse the repository at this point in the history
This reverts commit a3d1c07.
  • Loading branch information
jeryj authored Sep 17, 2024
1 parent 93af2dd commit 5adb8be
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { useSelect, useDispatch } from '@wordpress/data';
import { useRefEffect } from '@wordpress/compose';
import { create } from '@wordpress/rich-text';
import { isSelectionForward } from '@wordpress/dom';

/**
* Internal dependencies
Expand Down Expand Up @@ -54,14 +53,6 @@ function extractSelectionEndNode( selection ) {
return focusNode;
}

// When the selection is forward (the selection ends with the focus node),
// the selection may extend into the next element with an offset of 0. This
// may trigger multi selection even though the selection does not visually
// end in the next block.
if ( focusOffset === 0 && isSelectionForward( selection ) ) {
return focusNode.previousSibling ?? focusNode.parentElement;
}

return focusNode.childNodes[ focusOffset ];
}

Expand Down
16 changes: 0 additions & 16 deletions packages/dom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,6 @@ _Returns_

- `boolean`: True if rtl, false if ltr.

### isSelectionForward

Returns true if the given selection object is in the forward direction, or false otherwise.

_Related_

- <https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition>

_Parameters_

- _selection_ `Selection`: Selection object to check.

_Returns_

- `boolean`: Whether the selection is forward.

### isTextContent

_Parameters_
Expand Down
1 change: 0 additions & 1 deletion packages/dom/src/dom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ export { default as isEmpty } from './is-empty';
export { default as removeInvalidHTML } from './remove-invalid-html';
export { default as isRTL } from './is-rtl';
export { default as safeHTML } from './safe-html';
export { default as isSelectionForward } from './is-selection-forward';

0 comments on commit 5adb8be

Please sign in to comment.