Skip to content
Prev Previous commit
Next Next commit
Don't add 'wp-social-link-undefined' class
  • Loading branch information
Mamaduka authored and getdave committed Aug 30, 2024
commit f92378497274138eac5e06e0539dc117def6b8fe
3 changes: 2 additions & 1 deletion packages/block-library/src/social-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ const SocialLinkEdit = ( {
iconBackgroundColor,
iconBackgroundColorValue,
} = context;
const classes = clsx( 'wp-social-link', 'wp-social-link-' + service, {
const classes = clsx( 'wp-social-link', {
[ `wp-social-link-${ service }` ]: !! service,
'wp-social-link__is-incomplete': ! url,
Copy link
Contributor

Choose a reason for hiding this comment

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

The way this 'is-incomplete' CSS class works should be adjusted.
When the UI shows the 'link' icon button as a placeholder, the button is actually an actionable control. That is fine but it looks 'disabled' because, technically, it doesn't have the url prop set.
However, if we want to use this button as an actionable, enabled, focusable control then it can't look 'disabled'.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can remove this class. With update flow, the child block is either a placeholder or matches a service. What do you think?

[ `has-${ iconColor }-color` ]: iconColor,
[ `has-${ iconBackgroundColor }-background-color` ]:
Expand Down