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

Migrate the Input plugin to the beforeInput event #7997

Closed
oleq opened this issue Sep 2, 2020 · 1 comment
Closed

Migrate the Input plugin to the beforeInput event #7997

oleq opened this issue Sep 2, 2020 · 1 comment
Assignees
Labels
domain:dx This issue reports a developer experience problem or possible improvement. domain:ui/ux This issue reports a problem related to UI or UX. package:typing type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@oleq
Copy link
Member

oleq commented Sep 2, 2020

Provide a description of the task

Depending on the beforeInput being supported or not, this plugin should run either of sub-plugins/helpers (to be decided):

  • for new beforeInput-driven input,
  • for existing mutation-based input (injectUnsafeKeystrokesHandling(), injectTypingMutationsHandling()).

At least the following input event types should be handled:

  • insertText
  • insertReplacementText

Some extra things to be considered:

  • typing accented letters on Mac (which is NOT a composition but it already worked in the PoC),
  • what happens when the autocorrection kicks in (spell checker changes words as you type)?
  • does spell check work correctly (it worked on Mac in the PoC)?
@oleq oleq added type:task This issue reports a chore (non-production change) and other types of "todos". domain:dx This issue reports a developer experience problem or possible improvement. domain:ui/ux This issue reports a problem related to UI or UX. package:typing labels Sep 2, 2020
@Reinmar Reinmar mentioned this issue Sep 3, 2020
13 tasks
@oleq oleq added this to the iteration 36 milestone Sep 3, 2020
@oleq oleq added the squad:dx label Sep 3, 2020
@oleq oleq self-assigned this Sep 3, 2020
@Reinmar Reinmar modified the milestones: iteration 36, iteration 37 Sep 28, 2020
oleq added a commit that referenced this issue Oct 6, 2020
Feature (typing): Migrated `Input` and `Delete` features to the `beforeinput` event. Implemented `InsertTextCommand` and the `insertText` view document event. Closes [#7997](#7997). Closes [#7998](#7998). 

Feature (enter): Migrated the `Enter` feature (and `EnterObserver`) to the `beforeinput` event. Closes [#7999](#7999).

Other (engine): `MutationObserver` should only be loaded when the web browser does not support Input Events. Closes [#7999](#7999).

Other (engine): Added the `isComposing` property to the `beforeinput` event data (see [#7997](#7997)).

Tests (block-quote): Aligned feature tests to `beforeinput`-driven delete (see [#7998](#7998)).

Internal (engine): Aligned the `SelectionObserver` to the `beforeinput`-driven typing (see [#799](#7998).

Internal (link): Aligned the `LinkEditing` feature to the `beforeinput`-driven deleting. Used the `InsertTextCommand` instead of `InputCommand` in the `AutoLink` plugin. (see [#799](#7998, [#7998](#7998)).

Tests (list): Used `InsertTextCommand` instead of deprecated `InputCommand` (see [#799](#7998).

Tests (media-embed): Used `InsertTextCommand` instead of deprecated `InputCommand` (see [#799](#7998).

Internal (restricted-editing): Used `InsertTextCommand` instead of deprecated `InputCommand` (see [#799](#7998).

Internal (special-characters): Used `InsertTextCommand` instead of deprecated `InputCommand` (see [#799](#7998).

Internal (table): Aligned the `TableSelection` plugin to the `beforeinput`-driven typing (see [#799](#7998).

Internal (widget): Aligned the `WidgetTypeAround` plugin to the `beforeinput`-driven typing (see [#799](#7998).

BREAKING CHANGE (engine): The [`MutationObserver`](https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_observer_mutationobserver-MutationObserver.html) may no longer be [loaded by the editing view](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/editing-engine.html#observers). In web browsers that support DOM Input Events, its responsibilities have been taken over by [`InputObserver`](https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_observer_inputobserver-InputObserver.html).

BREAKING CHANGE (engine): The [`mutations`](https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_document-Document.html#event-event:mutations) event is no longer fired by the view document in web browsers that support DOM Input Events. To react to low-level changes in the document, use the [`beforeinput`](https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_document-Document.html#event-event:beforeinput) event instead, or better yet, take advantage of [`delete`](https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_document-Document.html#event-event:delete) and [`insertText`](https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_document-Document.html#event-event:insertText) events.

BREAKING CHANGE (typing): The [InputCommand](https://ckeditor.com/docs/ckeditor5/latest/api/module_typing_inputcommand-InputCommand.html) has been deprecated. Use the [`InsertTextCommand`](https://ckeditor.com/docs/ckeditor5/latest/api/module_typing_inserttextcommand-InsertTextCommand.html) instead (`editor.execute( 'insertText', options )`).

BREAKING CHANGE (typing): The [`@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling`](https://ckeditor.com/docs/ckeditor5/latest/api/module_typing_utils_injectunsafekeystrokeshandling.html) module containing typing helpers (e.g. [`isNonTypingKeystroke()`](https://ckeditor.com/docs/ckeditor5/latest/api/module_typing_utils_injectunsafekeystrokeshandling.html#function-isNonTypingKeystroke)) is now available under `@ckeditor/ckeditor5-typing/src/utils/input/utils`. Please update import paths in your projects to avoid import errors.
@oleq
Copy link
Member Author

oleq commented Oct 8, 2020

Closed in #8176.

@oleq oleq closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx This issue reports a developer experience problem or possible improvement. domain:ui/ux This issue reports a problem related to UI or UX. package:typing type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

2 participants