Skip to content

Commit

Permalink
Block editor: Add tooltip on replace image's url (#41504)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipposZ authored Jun 5, 2022
1 parent 731cc90 commit ce4affa
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions packages/block-editor/src/components/media-replace-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ToolbarButton,
Dropdown,
withFilters,
Tooltip,
} from '@wordpress/components';
import { useSelect, withDispatch } from '@wordpress/data';
import { DOWN } from '@wordpress/keycodes';
Expand Down Expand Up @@ -192,16 +193,21 @@ const MediaReplaceFlow = ( {
<span className="block-editor-media-replace-flow__image-url-label">
{ __( 'Current media URL:' ) }
</span>
<LinkControl
value={ { url: mediaURLValue } }
settings={ [] }
showSuggestions={ false }
onChange={ ( { url } ) => {
setMediaURLValue( url );
onSelectURL( url );
editMediaButtonRef.current.focus();
} }
/>

<Tooltip text={ mediaURLValue } position="bottom">
<div>
<LinkControl
value={ { url: mediaURLValue } }
settings={ [] }
showSuggestions={ false }
onChange={ ( { url } ) => {
setMediaURLValue( url );
onSelectURL( url );
editMediaButtonRef.current.focus();
} }
/>
</div>
</Tooltip>
</form>
) }
</>
Expand Down

0 comments on commit ce4affa

Please sign in to comment.