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 authored Mar 3, 2023
1 parent dbe47a5 commit 0ff8a04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ export function LinkUI( props ) {
placement="bottom"
onClose={ props.onClose }
anchor={ props.anchor }
__unstableSlotName={ '__unstable-block-tools-after' }
shift
>
<LinkControl
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/navigation-link/link-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ export function LinkUI( props ) {
placement="bottom"
onClose={ props.onClose }
anchor={ props.anchor }
__unstableSlotName={ '__unstable-block-tools-after' }
shift
>
<LinkControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { useHistory } from '../routes';
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 @@ -41,8 +43,9 @@ function SidebarNavigationScreenWrapper( { children, actions } ) {

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 @@ -52,15 +55,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 @@ -124,6 +126,7 @@ export default function SidebarNavigationScreenNavigationMenus() {

return (
<BlockEditorProvider
settings={ storedSettings }
value={ blocks }
onChange={ noop }
onInput={ noop }
Expand Down

1 comment on commit 0ff8a04

@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 0ff8a04.
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/4324311992
📝 Reported issues:

Please sign in to comment.