RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.39k stars 2.17k forks source link

WebComponent StencilJS - Inputmask is not a constructor/function #2415

Open ttorquati opened 3 years ago

ttorquati commented 3 years ago
import { Component, h, Host } from '@stencil/core';
import Inputmask from 'inputmask';

@Component({
    tag: 'custom-input',
    shadow: false,
})
export class CustomInput {
    componentDidLoad() {
        const inputElement = document.querySelector('input');

        // It is not a constructor
        var im = new Inputmask('99-9999999');
        im.mask(inputElement);

        // It is not a function
        //Inputmask({ mask: '99-9999999' }).mask(inputElement);
    }

    render() {
        return (
            <Host>
                <input type="text"></input>
            </Host>
        );
    }
}
Screen Shot 2020-10-27 at 15 05 15
trazek commented 3 years ago

Also having this issue. Any ideas?