Skip to content

Commit

Permalink
Remove template part double click focus mode editing in Write Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Dec 24, 2024
1 parent 536dff2 commit a9ebf69
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/block-library/src/template-part/edit/inner-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,16 @@ function EditableTemplatePartInnerBlocks( {
tagName: TagName,
blockProps,
} ) {
const onNavigateToEntityRecord = useSelect(
( select ) =>
select( blockEditorStore ).getSettings().onNavigateToEntityRecord,
const { onNavigateToEntityRecord, isNavigationMode } = useSelect(
( select ) => {
const { getSettings, isNavigationMode: _isNavigationMode } =
select( blockEditorStore );
return {
onNavigateToEntityRecord:
getSettings().onNavigateToEntityRecord,
isNavigationMode: _isNavigationMode(),
};
},
[]
);

Expand All @@ -123,7 +130,9 @@ function EditableTemplatePartInnerBlocks( {
const blockEditingMode = useBlockEditingMode();

const customProps =
blockEditingMode === 'contentOnly' && onNavigateToEntityRecord
! isNavigationMode &&
blockEditingMode === 'contentOnly' &&
onNavigateToEntityRecord
? {
onDoubleClick: () =>
onNavigateToEntityRecord( {
Expand Down

0 comments on commit a9ebf69

Please sign in to comment.