I am trying to expand HTML Element and I have a problem. Can't Custom Elements be defined in LWC?
Script
export default class DropBox extends LightningElement {
connectedCallback(){
// Input Element Extend
class DropBoxInput extends HTMLInputElement {
constructor() {
super();
this.addStyle();
}
addStyle(){
// Some Style...
}
}
customElements.define('dropBox-input',DropBoxInput,{extends:'input'});
}
}
Template
<template>
<input type="text" is="dropBox-input"/>
</template>
When I tried to save the code, I got a message that the "is" property was not available.
Is there a way to define Custom Element at LWC?