Skip to content

Commit

Permalink
navigation-menu-item: replace URLPopover by LinkControl [wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Oct 22, 2019
1 parent d5e0621 commit 5e85b47
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions packages/block-library/src/navigation-menu-item/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
InnerBlocks,
InspectorControls,
PlainText,
URLPopover,
LinkControl,
} from '@wordpress/block-editor';
import {
Fragment,
Expand Down Expand Up @@ -99,29 +99,10 @@ function NavigationMenuItemEdit( {
/>
{ isLinkOpen &&
<>
<URLPopover
<LinkControl
className="wp-block-navigation-menu-item__inline-link-input"
onClose={ closeURLPopover }
onFocusOutside={ onFocusOutside }
>
{ ( ! url || isEditingLink ) &&
<URLPopover.LinkEditor
value={ inputValue }
onChangeInputValue={ setUrlInput }
onKeyPress={ ( event ) => event.stopPropagation() }
onKeyDown={ onKeyDown }
onSubmit={ ( event ) => event.preventDefault() }
autocompleteRef={ autocompleteRef }
/>
}
{ ( url && ! isEditingLink ) &&
<URLPopover.LinkViewer
onKeyPress={ ( event ) => event.stopPropagation() }
url={ url }
/>
}

</URLPopover>
onKeyPress={ ( event ) => { event.stopPropagation() } }
/>
</>
}
</Toolbar>
Expand Down

0 comments on commit 5e85b47

Please sign in to comment.