Skip to content

Commit

Permalink
Fix: Custom link UI does appears outside canvas on the sidebar naviga…
Browse files Browse the repository at this point in the history
…tion. (#48633)
  • Loading branch information
jorgefilipecosta committed Mar 7, 2023
1 parent a628fe8 commit ebc797b
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import NavigationMenuContent from './navigation-menu-content';
import SidebarButton from '../sidebar-button';
import { NavigationMenuLoader } from './loader';
import { unlock } from '../../private-apis';
import { store as editSiteStore } from '../../store';

const noop = () => {};
const NAVIGATION_MENUS_QUERY = { per_page: -1, status: 'publish' };
Expand All @@ -44,8 +45,9 @@ const prioritizedInserterBlocks = [

export default function SidebarNavigationScreenNavigationMenus() {
const history = useHistory();
const { navigationMenus, hasResolvedNavigationMenus } = useSelect(
( select ) => {
const { navigationMenus, hasResolvedNavigationMenus, storedSettings } =
useSelect( ( select ) => {
const { getSettings } = unlock( select( editSiteStore ) );
const { getEntityRecords, hasFinishedResolution } =
select( coreStore );

Expand All @@ -55,15 +57,14 @@ export default function SidebarNavigationScreenNavigationMenus() {
NAVIGATION_MENUS_QUERY,
];
return {
storedSettings: getSettings( false ),
navigationMenus: getEntityRecords( ...navigationMenusQuery ),
hasResolvedNavigationMenus: hasFinishedResolution(
'getEntityRecords',
navigationMenusQuery
),
};
},
[]
);
}, [] );

// Sort navigation menus by date.
const orderedNavigationMenus = useMemo(
Expand Down Expand Up @@ -133,6 +134,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
const { PrivateInserter } = unlock( blockEditorPrivateApis );
return (
<BlockEditorProvider
settings={ storedSettings }
value={ blocks }
onChange={ noop }
onInput={ noop }
Expand Down

1 comment on commit ebc797b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in ebc797b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4352757675
📝 Reported issues:

Please sign in to comment.