ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

specialCharacters needs to be nullable and work with dropSpecialCharacters

Open Et3rnal opened this issue 7 months ago • 1 comments

🐞 bug report

specialCharacters needs to be nullable and work based on dropSpecialCharacters

Description

I use ngx-formly so I have a custom component which wrappers ngx-mask so I can use it in my ngx-formly forms. I noticed that I can't make specialCharacters attribute optional if I provide it with null or empty array it will block special Characters even when dropSpecialCharacters is set to false!!!

I tried to do [attr.specialCharacters] but that breaks the mask as well

the only way is to remove the specialCharacters all together!

The goal of using ngx-fromly to make reusable form components, so I need all of the ngx mask attributes to be available added to the HTML but only apply what id defined from the ts file

🔬 Minimal Reproduction

Let me know if you need this, there isn't any errors thats all you need

        <input
            [dropSpecialCharacters]="false"
            [specialCharacters]="[]"
            mask="A*@A*.A*"
        />

The @ is getting droped This shouldn't happen as dropSpecialCharacters is false, also since I must have specialCharacters if you allow it to be null and ignore all special characters or maybe give an option to include all like * if null not an option

or simply fix [attr.specialCharacters]=""

🔥 Exception or Error

None

🌍 Your Environment

Angular Version: 17.3.10


"ngx-mask": "^19.0.6",

Thanks

Et3rnal avatar Mar 04 '25 03:03 Et3rnal