-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove Popover from LinkControl component #19638
Conversation
} ) } | ||
onClose={ () => setIsLinkOpen( false ) } | ||
/> | ||
<Popover> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it not need a position here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed to work without it, maybe it was the default, I'll check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I restored this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
Checked with https://github.com/WordPress/gutenberg/pull/19638/files?utf8=✓&diff=unified&w=1
className={ classnames( 'block-editor-link-control', className ) } | ||
onClose={ closeLinkUI } | ||
position="bottom center" | ||
focusOnMount="firstElement" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these props no longer needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They seem unnecessary in my testing.
return; | ||
} | ||
|
||
function ConnectedLinkControl( props ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that I had to do that to make unit tests pass (test the unconnected component). Ideally, we'd find a way to easily mock useSelect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that I had to do that to make unit tests pass (test the unconnected component). Ideally, we'd find a way to easily mock useSelect
Follow-up at #19705
label: label || escape( newTitle ), | ||
opensInNewTab: newOpensInNewTab, | ||
} ) } | ||
onClose={ () => setIsLinkOpen( false ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been moved to the Popover
. LinkControl
no longer has an onClose
prop with the changes from this pull request.
Fix at: #19885
We should be able to use LinkControl outside of Popover.
Testing instructions