Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Writing flow: fix triple click inside text blocks" #65415

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Loading