I can't check textarea is focused or not. I'll try with following code but it does't work.
const msg_area = document.getElementById('msg-area') as HTMLInputElement;
if (msg-area.hasFocus()) {
// somecode
}
But it doesnot work. There was an error that hasFocus() not found. hasFocus() not a property of HtmlInputElement.