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

Source editing mode could be switched on and used via API even if plugin disabled #17738

Open
f1ames opened this issue Jan 10, 2025 · 0 comments
Labels
package:source-editing type:bug This issue reports a buggy (incorrect) behavior.

Comments

@f1ames
Copy link
Contributor

f1ames commented Jan 10, 2025

📝 Provide detailed reproduction steps (if any)

  1. Go to https://ckeditor.com/docs/ckeditor5/latest/examples/builds-custom/full-featured-editor.html.
  2. Open browser dev console.
  3. Run editor.plugins.get('SourceEditing').isEnabled = false.
    • Source Editing plugin gets disabled.
  4. Run editor.plugins.get('SourceEditing').isSourceEditingMode = true.
    • Editor is switched to source editing mode.
  5. Types something in the editor.
  6. Run editor.plugins.get('SourceEditing').isSourceEditingMode = false.
Screen.Recording.2025-01-10.at.11.23.26.mov

✔️ Expected result

I would expect that plugin will not react to switching to source mode via public API when being disabled.

❌ Actual result

It's possible to switch to source mode while plugin is disabled. What's more, modifying content in source mode and switching back, propagates it, modifying the content in WYSIWYG mode - all while Source Editing plugin is disabled.

Additional thoughts

I know that both isEnabled and isSourceEditingMode are public API so both can be easily changed by 3rd-party integration/action. Still, the behavior seems inconsistent and may be confusing for someone trying to integrate with it.

❓ Possible solution

...

📃 Other details

  • Browser: Chrome
  • OS: macOS
  • First affected CKEditor version: Not sure, checked on latest stable 44.1.0
  • Installed CKEditor plugins: SourceEditing

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

@f1ames f1ames added package:source-editing type:bug This issue reports a buggy (incorrect) behavior. labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:source-editing type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

1 participant