Skip to content

Input stuck when use mask + empty custom patterns #1584

@Bad-Company

Description

@Bad-Company

I'm trying to build a generic input component, where custom patterns are optional. However, if I pass an empty object, my input gets stuck. I also can't set patterns=undefined because TS will throw a type mismatch error. Currently, I just copied the library patterns and set them as a default.
Are there any better solutions?

<input
      [mask]="options.mask"
      [patterns]="options.customPatterns ?? {}"
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions