Open timandella opened 10 months ago
We have the following line of code in our angular project (where this.editor is the FroalaEditor component)
this.editor.events.on('keyup', (e: Event) => this.onKeyup.emit(new ComponentEvent('keyup', null, e)), false);
This was building fine in 4.1.0, but in 4.1.1 we now get a typescript error
Argument of type '(e: Event) => void' is not assignable to parameter of type '(event: string, param1?: any, param2?: any) => boolean | void'.
However, I added a console.log(e) to the function like so:
console.log(e)
this.editor.events.on( 'keyup', (e: string) => { console.log(e); this.onKeyup.emit(new ComponentEvent('keyup', null)); }, false, );
This then reveals that although it may be expecting a string, it is actually still being passed in an event.
{altKey: false, bubbles: true, cancelable: true, changedTouches: undefined, ctrlKey: false, …}
We have the following line of code in our angular project (where this.editor is the FroalaEditor component)
this.editor.events.on('keyup', (e: Event) => this.onKeyup.emit(new ComponentEvent('keyup', null, e)), false);
This was building fine in 4.1.0, but in 4.1.1 we now get a typescript error
Argument of type '(e: Event) => void' is not assignable to parameter of type '(event: string, param1?: any, param2?: any) => boolean | void'.
However, I added a
console.log(e)
to the function like so:This then reveals that although it may be expecting a string, it is actually still being passed in an event.
{altKey: false, bubbles: true, cancelable: true, changedTouches: undefined, ctrlKey: false, …}