Show:
Defined in: src/core/uicore.js:8

UICore class which will handle user interactions with the editor. These interactions might be triggered via mouse, keyboard or touch devices. The class fill fire an event via CKEditor's event system - "editorInteraction". The UI may listen to this event and execute some actions - for example to show/hide toolbars.

By default if user presses the Esc key, 'editorInteraction' event won't be fired. However, this behaviour can be changed by setting allowEsc config property in editor's configuration to true.

Methods

_createAriaElement

(
  • id
)
HTMLElement protected

Creates and applies an HTML element to the body of the document which will contain ARIA messages.

Parameters:

  • id String

    The provided id of the element. It will be used as prefix for the final element Id.

Returns:

HTMLElement:

The created and applied to DOM element.

init

(
  • editor
)
protected

Initializer lifecycle implementation for the UICore plugin.

Parameters:

  • editor Object

    The current CKEditor instance.

Attributes

allowEsc

Boolean

If set to true, the editor will still fire editorInteraction event, if user presses Esc key.

Default: false

timeout

Number

Specifies the default timeout after which the editorInteraction event will be fired.

Default: 50 (ms)

Events

ariaUpdate

Fired by UI elements like Toolbars or Buttons when their state changes. The listener updates the live region with the provided data.

Event Payload:

  • data Object

    An object which contains the following properties:

    • message - The provided message from the UI element.

editorInteraction

Fired when user interacts somehow with the browser. This may be clicking with the mouse, pressing keyboard button, or touching screen. This even will be not fired after each interaction. It will be debounced. By default the timeout is 50ms. This value can be overwritten via timeout property of editor's configuration, like: editor.config.uicore.timeout = 100

Event Payload:

  • data Object

    An object which contains the following properties:

    • nativeEvent - The event as received from CKEditor.
    • selectionData - The data, returned from getSelectionData