Skip to content

Method focus does not exist on type 'Element'. #14111

@prostoandrei

Description

@prostoandrei

Hello!

TypeScript Version: 2.1.6

Code

document.querySelector(`#id`).focus(); // Property 'focus' does not exist on type 'Element'
// but this work fine..
const a = <HTMLElement>document.querySelector(`[${this.horizonatalItemAttrName}]`);
a.focus();

Expected behavior: Focus exist on type 'Element'

Actual behavior: Property 'focus' does not exist on type 'Element'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions