feat: remove resize event handler

This commit is contained in:
Philipp Kühn
2021-04-16 12:51:47 +02:00
parent cf275e9417
commit 9f64015157
3 changed files with 0 additions and 23 deletions

View File

@@ -44,8 +44,6 @@ export class Editor extends EventEmitter {
public isFocused = false
private resizeObserver!: ResizeObserver
public options: EditorOptions = {
element: document.createElement('div'),
content: '',
@@ -64,7 +62,6 @@ export class Editor extends EventEmitter {
onTransaction: () => null,
onFocus: () => null,
onBlur: () => null,
onResize: () => null,
onDestroy: () => null,
}
@@ -89,13 +86,6 @@ export class Editor extends EventEmitter {
window.setTimeout(() => {
this.commands.focus(this.options.autofocus)
this.emit('create', { editor: this })
if (window.ResizeObserver) {
this.resizeObserver = new ResizeObserver(() => {
this.emit('resize', { editor: this })
})
this.resizeObserver.observe(this.view.dom)
}
}, 0)
}
@@ -416,8 +406,6 @@ export class Editor extends EventEmitter {
* Destroy the editor.
*/
public destroy(): void {
this.resizeObserver?.unobserve(this.view.dom)
this.emit('destroy')
if (this.view) {

View File

@@ -57,7 +57,6 @@ export interface EditorOptions {
onTransaction: (props: { editor: Editor, transaction: Transaction }) => void,
onFocus: (props: { editor: Editor, event: FocusEvent }) => void,
onBlur: (props: { editor: Editor, event: FocusEvent }) => void,
onResize: (props: { editor: Editor }) => void,
onDestroy: () => void,
}