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

Inconsistent behavior for URL fields #16902

Open
Comandeer opened this issue Aug 11, 2024 · 1 comment · May be fixed by #17633
Open

Inconsistent behavior for URL fields #16902

Comandeer opened this issue Aug 11, 2024 · 1 comment · May be fixed by #17633
Assignees
Labels
intro Good first ticket. package:image squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Comandeer
Copy link
Member

📝 Provide detailed reproduction steps (if any)

  1. Open https://ckeditor.com/docs/ckeditor5/latest/features/images/images-overview.html
  2. Select any text and press Ctrl/Cmd + K to open link balloon toolbar.
  3. Type any URL (e.g. https://ckeditor.com) and press Enter while the URL input is still focused. The link should be added
  4. Open the Image dropdown and select the "Insert via URL" option.
  5. Type any URL (e.g. https://placehold.co/200x300) and press Enter while the URL input is still focused.

✔️ Expected result

The image should be inserted into the editor – just like it happened with the link.

❌ Actual result

Nothing happens, the Enter keypress is ignored.

❓ Possible solution

The Enter key behavior from the Link balloon is connected with the implicit form submission behavior: if the text input in the form is focused when the user presses Enter, the form is submitted.

The input in the Link balloon is encapsulated inside a form and thanks to that, pressing Enter inserts the link. However, the input in the Image dialog is not encapsulated inside a form leading to a worse user experience (the user needs to either click the "Insert" button or – if they use only the keyboard for navigation – tab to the "Insert" button and press Enter/Space). Adding the form element to the Image dialog should fix the issue.

📃 Other details

  • Browser: N/A (de facto all browsers support the implicit form submission)
  • OS: N/A
  • First affected CKEditor version: 42.0.0
  • Installed CKEditor plugins: image

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

@Comandeer Comandeer added the type:bug This issue reports a buggy (incorrect) behavior. label Aug 11, 2024
@scofalik scofalik added the squad:collaboration Issue to be handled by the Collaboration team. label Aug 13, 2024
@oleq
Copy link
Member

oleq commented Aug 13, 2024

Looks like we're missing 'form' here

and a submit handler similar to this one

submitHandler( {
view: this
} );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intro Good first ticket. package:image squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants