-
Notifications
You must be signed in to change notification settings - Fork 319
Closed
Description
Hi! I try to use lit-element in my current project and previous I use that code
class HomePageSearch extends HTMLInputElement {
connectedCallback() {
console.log("works");
this.focus();
}
}
customElements.define("homepage-search", HomePageSearch, {extends: "input"});
and then in html I can use that component like <input is="homepage-search" >
. It's really important for me because in that case I can use that component without any css changes.
And now I want to convert the code to lit-element component. But I don't understand how because using that variant
import { LitElement } from "lit-element";
class HomePageSearch extends LitElement {
connectedCallback() {
console.log("works");
this.focus();
}
}
customElements.define("homepage-search", HomePageSearch, {extends: "input"});
I got the error TypeError: Class constructor bo cannot be invoked without 'new'
Thank you
Browsers Affected
- Chrome
Versions
- lit-element: v2.1
- webcomponents: v1
Metadata
Metadata
Assignees
Labels
No labels