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

Closed
Comandeer opened this issue Aug 11, 2024 · 1 comment · Fixed by #17633
Closed

Inconsistent behavior for URL fields #16902

Comandeer opened this issue Aug 11, 2024 · 1 comment · 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.
Milestone

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
} );

@oleq oleq added the intro Good first ticket. label Aug 13, 2024
f1ames pushed a commit that referenced this issue Dec 17, 2024
…sing "enter" key. Closes #16902.

* Allow closing dialog on enter click

* Add test for image insert via url to check if can be closed by clicking enter

* Add new parameter to dialog to indicate if should have form tag.

* Change insert image via url dialog submit on enter

* Fix comments in image insert via url tests

* fix tests
@CKEditorBot CKEditorBot added this to the iteration 82 milestone Dec 17, 2024
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.

6 participants