Skip to content

Conversation

@thomasdax98
Copy link
Member

@thomasdax98 thomasdax98 commented Dec 15, 2025

Description

Add UrlField and FinalFormUrlInput components for URL input with automatic protocol handling

The new components automatically add https:// protocol to URLs that don't have a protocol when the field loses focus. Existing protocols (e.g., mailto:, ftp://) are preserved.
The field also has a rudimentary validation to check if a protocol is present.

https://deploy-preview-4949.storybook.comet-dxp.com/?path=/docs/comet-admin-form-urlfield--docs

Acceptance criteria

TODOs

  • Is the validation sufficient?
  • Does it even make sense to support mailto and tel?
  • Is a possibility needed to only allow certain protocols?

Further information

@thomasdax98 thomasdax98 changed the title Draft: Url field Draft: UrlField Dec 15, 2025
const schemeMatch = /^([a-zA-Z][a-zA-Z\d+.-]*):(.*)$/.exec(trimmedValue);

if (!schemeMatch) {
return "URL must include a protocol (e.g., https://, http://, mailto:)";
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Formatted message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants