Kaynağa Gözat

Merge pull request #1914 from ckeditor/t/ckeditor5-react/102

Docs: Fix React integration guide. Closes ckeditor/ckeditor5-react#102.
Piotrek Koszuliński 6 yıl önce
ebeveyn
işleme
11213493e2
1 değiştirilmiş dosya ile 11 ekleme ve 11 silme
  1. 11 11
      docs/builds/guides/frameworks/react.md

+ 11 - 11
docs/builds/guides/frameworks/react.md

@@ -45,10 +45,10 @@ class App extends Component {
 						const data = editor.getData();
 						console.log( { event, editor, data } );
 					} }
-					onBlur={ editor => {
+					onBlur={ ( event, editor ) => {
 						console.log( 'Blur.', editor );
 					} }
-					onFocus={ editor => {
+					onFocus={ ( event, editor ) => {
 						console.log( 'Focus.', editor );
 					} }
 				/>
@@ -67,16 +67,16 @@ The `<CKEditor>` component supports the following properties:
 * `editor` (required) &ndash; The {@link module:core/editor/editor~Editor `Editor`} constructor to use.
 * `data` &ndash; The initial data for the created editor. See the {@link builds/guides/integration/basic-api#interacting-with-the-editor Basic API} guide.
 * `config` &ndash; The editor configuration. See the {@link builds/guides/integration/configuration Configuration} guide.
+* `onInit` &ndash; A function called when the editor was initialized. It receives the initialized {@link module:core/editor/editor~Editor `editor`} as a parameter.
+* `disabled` &ndash; A boolean. The {@link module:core/editor/editor~Editor `editor`} is being switched to read-only mode if the property is set to `true`.
 * `onChange` &ndash; A function called when the editor's data has changed. See the {@link module:engine/model/document~Document#event:change:data `editor.model.document#change:data`} event.
+* `onBlur` &ndash; A function called when the editor was blurred. See the {@link module:engine/view/document~Document#event:blur `editor.editing.view.document#blur`} event. 
+* `onFocus` &ndash; A function called when the editor was focused. See the {@link module:engine/view/document~Document#event:focus `editor.editing.view.document#focus`} event.
 
-	The callback receives two parameters:
+The editor events callbacks (`onChange`, `onBlur`, `onFocus`) receive two parameters:
 
-	1. An {@link module:utils/eventinfo~EventInfo `EventInfo`} object,
-	2. An {@link module:core/editor/editor~Editor `Editor`} instance.
-* `onInit` &ndash; A function called when the editor was initialized. It receives the initialized {@link module:core/editor/editor~Editor `editor`} as a parameter.
-* `onBlur` &ndash; A function called when the editor was blurred. It receives the blurred {@link module:core/editor/editor~Editor `editor`} as a parameter.
-* `onFocus` &ndash; A function called when the editor was focused. It receives the focused {@link module:core/editor/editor~Editor `editor`} as a parameter.
-* `disabled` &ndash; A boolean. The {@link module:core/editor/editor~Editor `editor`} is being switched to read-only mode if the property is set to `true`.
+1. An {@link module:utils/eventinfo~EventInfo `EventInfo`} object,
+2. An {@link module:core/editor/editor~Editor `Editor`} instance.
 
 ### Customizing the builds
 
@@ -312,10 +312,10 @@ class App extends Component {
 						const data = editor.getData();
 						console.log( { event, editor, data } );
 					} }
-					onBlur={ editor => {
+					onBlur={ ( event, editor ) => {
 						console.log( 'Blur.', editor );
 					} }
-					onFocus={ editor => {
+					onFocus={ ( event, editor ) => {
 						console.log( 'Focus.', editor );
 					} }
 				/>