Skip to content
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

Empty value is getting added as a link to a text. #12501

Closed
vanathishiv opened this issue Sep 22, 2022 · 9 comments · Fixed by #15633
Closed

Empty value is getting added as a link to a text. #12501

vanathishiv opened this issue Sep 22, 2022 · 9 comments · Fixed by #15633
Assignees
Labels
domain:ui/ux This issue reports a problem related to UI or UX. domain:v4-compatibility This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5. package:link squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@vanathishiv
Copy link

📝 Provide detailed reproduction steps (if any)

  1. …Enter any text in the editor
  2. …Click and select on Link in toolbar without entering anything.
  3. …Empty hyperlink is getting added.

✔️ Expected result

Empty value shouldn't be getting added as a link.
Emptylink_Cke5issue

❌ Actual result

Empty value is getting added as a link to a text.

📃 Is this the expected behavior or is there anyway we could have validation?

  • Browser: … Google Chrome 105
  • OS: … Windows 10 Pro/Win64; x64

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@vanathishiv vanathishiv added the type:bug This issue reports a buggy (incorrect) behavior. label Sep 22, 2022
@vanathishiv
Copy link
Author

It would be great, if we could get any update on this.

@lslowikowska lslowikowska added the support:2 An issue reported by a commercially licensed client. label Oct 17, 2022
@Reinmar
Copy link
Member

Reinmar commented Nov 9, 2022

CKE5 needs to preserve empty links as they unfortunately may exist in a content. 

As for the UI, there's no validation indeed. How do you think it should work? And why do you think there should be validation?

@vanathishiv
Copy link
Author

so, earlier in CKe4 the URL was a mandatory field in the popup of link so when user doesn't enter it'll throw an error.
Now we are able to add a hyperlink without giving one and on further saving, empty value is getting added as a link to a text and that could be misleading to the customers.

So the customers were expecting the behaviour to be same as of CKe4.
We got reply from the support team saying "Unfortunately, currently we have no plans for changing this behaviour. I will let you know if we decide to work in that in the future."

@joegl
Copy link

joegl commented Oct 27, 2023

This is a big regression for us going from CKEditor 4 to CKEditor 5. We allow content editors to put button styles on <a> elements and previously they were not allowed to create links without URL's. Now users are complaining there are buttons on their site that don't link anywhere. It's certainly user error and you'd want users to to not do that, but that's not how users work. And this didn't use to even be a possible, so it's definitely a regression.

We're not asking for empty URL's to be banned everywhere. It'd just be nice to have a mechanism/option to not allow empty URL's that we could configure.

@joegl
Copy link

joegl commented Oct 27, 2023

CKE5 needs to preserve empty links as they unfortunately may exist in a content.

Preserving empty links in the editor isn't a problem, it's being allowed to create them in the first place. We don't want to strip them if they're in the editor, and meant to be there. We just don't want our users to be allowed to create them without manually editing the source code. Just a toggleable option to prevent blank input in the URL field would suffice.

@Witoso Witoso added domain:v4-compatibility This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5. domain:ui/ux This issue reports a problem related to UI or UX. labels Oct 30, 2023
@Witoso
Copy link
Member

Witoso commented Oct 30, 2023

Thanks @joegl for feedback! I will bring it for discussions internally on our side.

@Witoso
Copy link
Member

Witoso commented Nov 6, 2023

Internally, we decided on the future scope:

  • There's going to be a configuration option that manages that, for example allowEmptyLinksCreation.
  • By default, the editor should not allow creation of empty links via the UI (form validation, allowEmptyLinksCreation:false).
  • To allow it (and disable validation) set allowEmptyLinksCreation:true
  • Migration guide needs to be prepared.

The editor will still preserve empty links when loaded.

@joegl
Copy link

joegl commented Nov 6, 2023

@Witoso That sounds wonderful! Thanks for your considerations and responding to this. When would you anticipate this change being completed and release?

@Witoso
Copy link
Member

Witoso commented Nov 7, 2023

No ETA yet, this will enter our support queue as an improvement.

@filipsobol filipsobol self-assigned this Jan 4, 2024
@filipsobol filipsobol added the squad:core Issue to be handled by the Core team. label Jan 4, 2024
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jan 4, 2024
filipsobol added a commit that referenced this issue Jan 8, 2024
MINOR BREAKING CHANGE (link): Add validation to the URL field to disallow empty URL by default. Closes #12501.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jan 8, 2024
@CKEditorBot CKEditorBot added this to the iteration 70 milestone Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. domain:v4-compatibility This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5. package:link squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants