-
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
Switch Social Links to use LinkControl component #20740
Conversation
Size Change: +117 B (0%) Total Size: 864 kB
ℹ️ View Unchanged
|
Re-using UI components to create consistency is a noble goal, 👍 👍 on that aspect. I don't personally think the "open in new tab" feature is something anyone should use, so good to default to off. Specifically in the case of social links, this feels like a property you set on the social links block itself, not each individual block — I have a hard time picturing why you'd want some of your social links to open in new tabs, and not others. But I imagine that would create a ton of extra complexity. So probably futile. However I'm seeing a duplicate Enter sign: Which is a little weird, as it doesn't look like you've modified the control itself. Any idea what's up here? Also, we'll want some different placeholder text than "Search or type url" (btw shouldn't url be capitalized?) We could go with just "Enter address" which is what the old version said. |
The placeholder text is from the LinkControl component, with that I realized it uses suggestions for local links and does not appear to have a disable flag like URLInput. In my tests I was typing URLs but if I start to type a local blog post title it shows. Combined with the "open in tab" on every link, we might not be able to use the LinkControl component as-is. Maybe just adding "opensInNewTab" attribute to the container SocialLinks block and then pass that down to the contained links would be the better approach, set once and apply to all. |
I'm going to close this PR, because using the LinkControl component is not quite what we want to do because it would require each link to set the open in new tabs attribute — this is awkward. The ideal solution is to add the property to the parent Social Links block, and then on server-side render read the property and attach the target attribute as needed. For this we need to wait on: #19685 |
Description
This updates the Social Links to use the LinkControl component instead of URLInput, this allows for setting the "opens in external tab" property.
Fixes #20707
How has this been tested?
Screenshots
Types of changes
URLInput
toLinkControl
opensInNewTab