Is there a way to retrieve the height of an element when a specific event occurs?
I am trying to obtain the height of an editable div
, but it seems that EventTarget
does not have the necessary properties.
import { LitElement, html, customElement } from 'lit-element';
@customElement('my-example')
export class Example extends LitElement {
render() {
return html`
<div
@keyup="${(e: KeyboardEvent) => console.log(e.target?.offsetHeight)}"
contenteditable="true"
></div>
`;
}
}
Error:
Property 'offsetHeight' does not exist on type 'EventTarget'.