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

Edit mode: arrow up/down should not move to other blocks #22204

Closed
wants to merge 8 commits into from
29 changes: 0 additions & 29 deletions packages/block-editor/src/components/writing-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
isTextField,
isVerticalEdge,
placeCaretAtHorizontalEdge,
placeCaretAtVerticalEdge,
isEntirelySelected,
} from '@wordpress/dom';
import {
Expand Down Expand Up @@ -538,34 +537,6 @@ export default function WritingFlow( { children } ) {
// Moving from block multi-selection to single block selection
moveSelection( isReverse );
event.preventDefault();
} else if ( isVertical && isVerticalEdge( target, isReverse ) ) {
const closestTabbable = getClosestTabbable(
target,
isReverse,
container.current,
true
);

if ( closestTabbable ) {
placeCaretAtVerticalEdge(
closestTabbable,
isReverse,
verticalRect.current
);
event.preventDefault();
}
} else if (
isHorizontal &&
getSelection().isCollapsed &&
isHorizontalEdge( target, isReverseDir )
) {
const closestTabbable = getClosestTabbable(
target,
isReverseDir,
container.current
);
placeCaretAtHorizontalEdge( closestTabbable, isReverseDir );
event.preventDefault();
}
}

Expand Down