-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Invalid links for social icons #69140
Comments
I tried to fix this by using a Below is a screencast demonstrating the approach: Just a raw implementation, there are places where it can be improved like only showing error when the user enters the url Screen.Recording.2025-02-11.at.5.29.10.PM.mov |
Thank you @Rishit30G for opening the issue. The type is set to "text" in the Additional checks to validate correct URLs would help. But at the very least I think, the type should be "url" instead of "text" This would further improve the proper positioning of the URL in RTL languages. Related issue: #68188 gutenberg/packages/block-editor/src/components/url-input/index.js Lines 452 to 453 in 05c8450
|
Thanks for sharing this @im3dabasia! 👍🏻
That's true. IMO, we should be a bit more flexible with the URLs, using |
I agree. Please note that there is a social icon for email - meaning other URI schemes must work, like |
IIRC, this is using a test for a reason. When you combine all possible values for Social Links, validation becomes complicated, and that would be truer when the block allows consumers to add custom variations. Additionally, themes like to use placeholder values, which might not be a correct URLs. I think the simplest solution here is to trust users to input the correct URLs. |
Valid points, makes sense 👍🏻 Let me know if I should close this issue then |
Thanks, @Rishit30G! Yes, let's close the issue. |
Description
Currently, there is no validation mechanism to ensure that users enter a valid URL for social icons. This lack of validation can lead to issues when incorrect or improperly formatted URLs are added. To prevent potential errors, we need to implement a validation check that ensures only properly structured URLs are accepted in the input field.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Screen.Recording.2025-02-11.at.4.45.00.PM.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: