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

Migration guide for changed placeholder API #14686

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/updating/updating-ckeditor-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,26 @@ A collaboration session will be removed 24 hours after the last user disconnects
<info-box>
If you are using Collaboration Server On-premises, it is recommended to keep it updated at all times, just like CKEditor 5. Our collaboration features are strongly linked with Cloud Services, so it is important to keep compatibility between On-premises and CKEditor 5.
</info-box>

### Breaking changes

#### Placeholder

Function `enablePlaceholder()` no longer gets `text` in `options` as argument. To define a value of placeholder you need to specify it in your `element` which is actually passed into `options`.

```js
element.placeholder = 'Type something...'

enablePlaceholder( {
view: editingView,
element: element,
isDirectHost: false,
keepOnFocus: true
} );
```

Now if you need to update your placeholder you could just update `placeholder` property in your element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll drop this part as this is not a part of breaking change (it wasn't possible before, so there's no need to explain it here).


```js
editor.editing.view.document.getRoot( 'main' ).placeholder = 'new placeholder';
```