stable

Clone or download

Read-only

fix: broken url validation in link and image popovers

Part of story #38627: Choice of a new Rich Text Editor When the url of a link or an image does not respect the validation pattern, then the form submission is expected to be blocked, and an error message should be displayed below the field in error. However, the `data-dismiss="popover"` attributes on the submit buttons break the validation by closing the popover while the browser is trying to set the form validation error message. Let's remove them and hide the popovers properly when images/links have been successfully submitted. How to test: - For both link and image popovers, try to submit without entering an url --> You get an error message "Please fill out this field" - Enter a not valid url (e.g it does not start with https://) and try to submit the form --> You get an error message "Please enter a URL" - Enter a valid url and submit --> Success Change-Id: Ia0f2bbeef7f640d9ca5e85b85e135455608efdbd

Modified Files

Name
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/common/connect-popover.test.ts +10 −7 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/common/connect-popover.ts +4 −2 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image-popover-template.test.ts +5 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image-popover-template.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image.ts +1 −0 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link-popover-template.test.ts +6 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link-popover-template.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link.ts +1 −0 Go to diff View file