Skip to content

Commit

Permalink
Revert "wip"
Browse files Browse the repository at this point in the history
This reverts commit 4075ff4.
  • Loading branch information
ellatrix committed Aug 5, 2024
1 parent dc837d7 commit 8f32a38
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
}

return {
contentEditable: false,
tabIndex: blockEditingMode === 'disabled' ? -1 : 0,
...wrapperProps,
...props,
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/writing-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export function useWritingFlow() {
return;
}

if ( root === node ) {
return;
}

const init = {};

for ( const key in event ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ function findDepth( a, b ) {
* @param {boolean} value `contentEditable` value (true or false)
*/
function setContentEditableWrapper( node, value ) {
value = true;
// Since we are calling this on every selection change, check if the value
// needs to be updated first because it trigger the browser to recalculate
// style.
Expand Down
6 changes: 1 addition & 5 deletions packages/block-editor/src/components/writing-flow/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export function getSelectionRoot( ownerDocument ) {
const { defaultView } = ownerDocument;
const { anchorNode, focusNode } = defaultView.getSelection();

console.log( { anchorNode, focusNode } );

if ( ! anchorNode || ! focusNode ) {
return;
}
Expand All @@ -131,9 +129,7 @@ export function getSelectionRoot( ownerDocument ) {
anchorNode.nodeType === anchorNode.ELEMENT_NODE
? anchorNode
: anchorNode.parentElement
).closest( '[contenteditable="true"]' );

console.log( { anchorElement } );
).closest( '[contenteditable]' );

if ( ! anchorElement ) {
return;
Expand Down

0 comments on commit 8f32a38

Please sign in to comment.