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

Backspace/delete should be blocked if the editor is read only #4577

Closed
Reinmar opened this issue Jul 13, 2017 · 6 comments · Fixed by ckeditor/ckeditor5-widget#21
Closed
Assignees
Labels
package:widget type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Jul 13, 2017

Reported in https://github.com/ckeditor/ckeditor5-typing/issues/109.

Interestingly, if the widget feature extended the command instead of handling the feature, the problem would not exist, so it'd be worth checking if that's possible.

@pomek
Copy link
Member

pomek commented Sep 19, 2017

Could you explain the integration with the command a little bit more?

@Reinmar
Copy link
Member Author

Reinmar commented Sep 19, 2017

The backspace/delete support for widgets is implemented in ckeditor5-widget/src/widget.js and has nothing to do with the command. It listens on the view layer but it does not consider the editor status, which is the bug.

@szymonkups
Copy link
Contributor

Some idea: command's execute() event is decorated. Maybe we can listen to that event (which will not be fired if command is disabled) instead of listening to delete key event?

@Reinmar
Copy link
Member Author

Reinmar commented Sep 19, 2017

This should work, but taken that the keydown listener handles 3 types of actions now (delete, select all, arrows) we need to fix the keydown listener anyway.

In general, it would be good if this code plugged into the command.

But that's a too big task for this ticket.

@pomek
Copy link
Member

pomek commented Sep 19, 2017

Ok, so do we have some plan? Or should I fix the bug the easiest way?

@Reinmar
Copy link
Member Author

Reinmar commented Sep 19, 2017

Or should I fix the bug the easiest way?

That's the plan – easiest correct way.

Reinmar referenced this issue in ckeditor/ckeditor5-widget Sep 20, 2017
Fix: <kbd>Backspace</kbd> and <kbd>Delete</kbd> should not delete a widget when the editor is in the read-only mode. Closes #6.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-widget Oct 9, 2019
@mlewand mlewand added this to the iteration 12 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. package:widget labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:widget type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants