Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: fix required status of onSelectUrl prop of MediaReplaceFlow component #44025

Merged

Conversation

fabiankaegy
Copy link
Member

What?

Fix documaentation of the MediaReplaceFlow component to indicate that the onSelectUrl prop is not actually required.

Looking at the sourcecode the code checks for the presence of the prop and only renders the media url field if the callback function was provided.

{ onSelectURL && (
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<form className="block-editor-media-flow__url-input">
<span className="block-editor-media-replace-flow__image-url-label">
{ __( 'Current media URL:' ) }
</span>
<Tooltip text={ mediaURL } position="bottom">
<div>
<LinkControl
value={ { url: mediaURL } }
settings={ [] }
showSuggestions={ false }
onChange={ ( { url } ) => {
onSelectURL( url );
editMediaButtonRef.current.focus();
} }
/>
</div>
</Tooltip>
</form>
) }

Why?

Because the current documentation is misleading

@fabiankaegy fabiankaegy added the [Type] Developer Documentation Documentation for developers label Sep 9, 2022
@fabiankaegy fabiankaegy self-assigned this Sep 9, 2022
@gziolo gziolo assigned draganescu and unassigned draganescu Sep 9, 2022
@gziolo gziolo requested a review from draganescu September 9, 2022 10:52
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Makes sense 👍

@fabiankaegy fabiankaegy merged commit 5c1d6ba into trunk Sep 9, 2022
@fabiankaegy fabiankaegy deleted the docs/fix-required-state-of-media-replace-flow-prop branch September 9, 2022 12:48
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants