Code Monkey home page Code Monkey logo

input-mask's Introduction

@ngneat/input-mask


npm (scoped) MIT commitizen PRs styled with prettier All Contributors ngneat-lib spectator semantic-release

@ngneat/input-mask is an angular library that creates an input mask. Behind the scene, it uses inputmask.

Compatibility with Angular Versions

@ngneat/input-mask Angular
4.x.x >= 11.2.7 < 13
5.x.x 13
6.x.x 14

Features

  • ๐Ÿ”ก Support for form validation
  • ๐ŸŽญ Wrapper function to easily create input-masks
  • ๐Ÿ” Helps you to convert final values to desired format
  • โ˜๏ธ Single directive to handle everything
  • ๐Ÿ›  All the configurations of inputmask provided

Installation

Angular

You can install it through Angular CLI, which is recommended:

ng add @ngneat/input-mask

or with npm

npm install @ngneat/input-mask inputmask@5
npm install -D @types/inputmask@5

When you install using npm or yarn, you will also need to import InputMaskModule in your app.module:

import { InputMaskModule } from '@ngneat/input-mask';

@NgModule({
  imports: [InputMaskModule],
})
class AppModule {}

Config

There few configuration options available with InputMaskModule:

import { InputMaskModule } from '@ngneat/input-mask';

@NgModule({
  imports: [InputMaskModule.forRoot({ inputSelector: 'input', isAsync: true })],
})
class AppModule {}
Option Type Description Default Value
inputSelector string CSS selector, which will be used with querySelector to get the native input from host element. This is useful when you want to apply input-mask to child <input> of your custom-component input
isAsync boolean If set true, MutationObserver will be used to look for changes until it finds input with inputSelector false

Usage examples

1. Date

import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { createMask } from '@ngneat/input-mask';

@Component({
  selector: 'app-root',
  template: `
    <input
      [inputMask]="dateInputMask"
      [formControl]="dateFC"
      placeholder="dd/mm/yyyy"
    />
  `,
})
export class AppComponent {
  dateInputMask = createMask<Date>({
    alias: 'datetime',
    inputFormat: 'dd/mm/yyyy',
    parser: (value: string) => {
      const values = value.split('/');
      const year = +values[2];
      const month = +values[1] - 1;
      const date = +values[0];
      return new Date(year, month, date);
    },
  });

  dateFC = new FormControl('');
}

2. IP Address

@Component({
  template: `
    <input
      [inputMask]="ipAddressMask"
      [formControl]="ipFC"
      placeholder="_._._._"
    />
  `,
})
export class AppComponent {
  ipAddressMask = createMask({ alias: 'ip' });
  ipFC = new FormControl('');
}

3. Currency

@Component({
  template: `
    <input
      [inputMask]="currencyInputMask"
      [formControl]="currencyFC"
      placeholder="$ 0.00"
    />
  `,
})
export class AppComponent {
  currencyInputMask = createMask({
    alias: 'numeric',
    groupSeparator: ',',
    digits: 2,
    digitsOptional: false,
    prefix: '$ ',
    placeholder: '0',
  });
  currencyFC = new FormControl('');
}

4. License Plate

@Component({
  template: `
    <input
      [inputMask]="licenseInputMask"
      [formControl]="licenseFC"
      placeholder="___-___"
    />
  `,
})
export class AppComponent {
  licenseInputMask = createMask('[9-]AAA-999');
  licenseFC = new FormControl('');
}

5. Email

@Component({
  template: `
    <input
      [inputMask]="emailInputMask"
      [formControl]="emailFC"
      placeholder="_@_._"
    />
  `,
})
export class AppComponent {
  emailInputMask = createMask({ alias: 'email' });
  emailFC = new FormControl('');
}

6. Custom Component

If you have some component and you want to apply input-mask to the inner <input> element of that component, you can do that.

For example, let's assume you have a CustomInputComponent:

@Component({
  selector: 'app-custom-input',
  template: `
    <input
      [formControl]="formControl"
      [inputMask]="inputMask"
      [placeholder]="placeholder"
    />
  `,
})
export class CustomInputComponent {
  @Input() formControl!: FormControl;
  @Input() inputMask!: InputmaskOptions<any>;
  @Input() placeholder: string | undefined;
}

And your AppComponent looks like this:

@Component({
  selector: 'app-root',
  template: `
    <app-custom-input
      [formControl]="dateFCCustom"
      [inputMask]="dateInputMaskCustom"
      placeholder="Date"
    ></app-custom-input>
  `,
})
export class AppComponent {
  dateInputMaskCustom = createMask<Date>({
    alias: 'datetime',
    inputFormat: 'dd/mm/yyyy',
    parser: (value: string) => {
      const values = value.split('/');
      const year = +values[2];
      const month = +values[1] - 1;
      const date = +values[0];
      return new Date(year, month, date);
    },
  });
  dateFCCustom = new FormControl('');
}

So to apply input-mask on CustomInputComponent, use configuration with InputMaskModule like below:

import { InputMaskModule } from '@ngneat/input-mask';

@NgModule({
  imports: [
    InputMaskModule.forRoot({
      isAsync: false, // set to true if native input is lazy loaded
      inputSelector: 'input',
    }),
  ],
})
class AppModule {}

More examples

All examples are available on stackblitz.

You can create any type of input-mask which is supported by InputMask plugin.

Validation

When [inputMask] is used with [formControl], it adds validation out-of-the box. The validation works based on isValid function.

If the validation fails, the form-control will have below error:

{ "inputMask": true }

createMask wrapper function

This library uses inputmask plugin to handle mask related tasks. So, you can use all the options available there.

The recommended way to create an inputmask is to use the createMask function provided with this library.

parser function

Apart from inputmask options, we have added one more option called parser. This basically helps you to keep the value of form-control in pre-defined format, without updating UI.

For example, you want your users to enter date in input[type=text] with dd/mm/yyyy format and you want to store a Date value in the form-control:

@Component({
  template: `
    <input
      [inputMask]="dateInputMask"
      [formControl]="dateFC"
      placeholder="dd/mm/yyyy"
    />
  `,
})
export class AppComponent {
  dateInputMask = createMask<Date>({
    alias: 'datetime',
    inputFormat: 'dd/mm/yyyy',
    parser: (value: string) => {
      const values = value.split('/');
      const year = +values[2];
      const month = +values[1] - 1;
      const date = +values[0];
      return new Date(year, month, date);
    },
  });

  dateFC = new FormControl('');
}

In above example, whenver you try to access dateFC.value, it won't be the string which user entered, but rather a Date created based on the parser function.

formatter function

Apart from the parser function, we have added one more option called formatter. This helps you if you want to change the format of a date you receive from the Database.

For example, you receive a date from your database in the format 'yyyy-MM-dd' but you want to display it 'dd/MM/yyyy'.

@Component({
  template: `
    <input
      [inputMask]="dateInputMask"
      [formControl]="dateFC"
      placeholder="dd/mm/yyyy"
    />
  `,
})
export class AppComponent {
  dateInputMask = createMask<Date>({
    alias: 'datetime',
    inputFormat: 'dd/MM/yyyy',
    formatter: (value: string) => {
      const values = value.split('-');
      const date = +values[2];
      const month = +values[1] - 1;
      const year = +values[0];
      return formatDate(new Date(year, month, date), 'dd/MM/yyyy', 'en-US');
    },
  });

  dateFC = new FormControl('1990-12-28');
}

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Dharmen Shah

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐Ÿ’ก ๐Ÿšง ๐Ÿ“ฆ

Netanel Basal

๐Ÿ› ๐Ÿ’ผ ๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ“† ๐Ÿ‘€

Robin Herbots

๐Ÿค”

P. Zontrop

๐Ÿ“ฆ

Artur Androsovych

๐Ÿšง โš ๏ธ

Pawel Boguslawski

๐Ÿšง

This project follows the all-contributors specification. Contributions of any kind welcome!!

input-mask's People

Contributors

allcontributors[bot] avatar arturovt avatar bogusweb avatar c450 avatar eltociear avatar semantic-release-bot avatar shhdharmen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

input-mask's Issues

Angular does not render modules where InputMaskModule is imported on server (SSR, Universal)

I'm submitting a bug report


[x] Bug report  

Current behavior

Angular does not render modules (and components) where InputMaskModule is imported on server (SSR, Universal).

Expected behavior

Angular should render any module that imports InputMaskModule

Minimal reproduction of the problem with instructions

I've prepared playground repo: https://github.com/ectuser/input-mask-ssr-playground

Please install dependencies (yarn) and run yarn dev:ssr or yarn build && yarn build:ssr && yarn serve:ssr

Find the route http://localhost:4200/base. View page source - the module is not rendered on the server.

In the /base route a module imports InputMaskModule from the original repo.

Then please find a route http://localhost:4200/new. View page source - a component is rendered on server.

In the /new route a module imports InputMaskModule from the temporary package I've created.

The way I fixed the issue - #98

However, I think there might be a better options than dynamically load 'inputmask' library.

Environment


Angular version: 15.2.0

Issue also appears in v14.3.0

Browser:
Any browser
 
For Tooling issues:
- Node version: v18.16.0
- Platform:  Mac

PatchValue of masked input with unmasked value

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:

Current behavior

Field with input mask doesn't get updated when patchValue is used with autoUnmask value.

Expected behavior

Input with the mask to accept the raw value

Minimal reproduction of the problem with instructions

I have a

phoneInputMask = createMask({
    mask: '(999) 999-99-99',
    autoUnmask: true
});

on a <input formControlName="phone" type="tel" [inputMask]="phoneInputMask"/> that needs to be populated with form.patchValue(phone).
I assume the issue is due to the raw value (0123456789) not matching the initial mask: '(999) 999-99-99'.

What is the motivation / use case for changing the behavior?

To patchValue() of a masked input with an unmasked value

Environment


Angular version: 12.1.4


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 14.4.2  
- Platform:  Mac

Update Inputmask library

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

How i can create pull request with update Inptumask dependency for both versions?

Validation does not respect optional fields

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Empty inputs without required="true" fail validation.

Expected behavior

The form control should be considered valid if it is empty ('', null, undefined).

Minimal reproduction of the problem with instructions

Add [required]="false" to any of the inputs in the Stackblitz linked in the README, and observe that isValid still shows as true and there is an entry in the errors object.

What is the motivation / use case for changing the behavior?

There is no way to represent a non-required masked field currently. The behavior of Angular's built-in validators is that they do not validate empty inputs, and leave that to the "required" validator instead. The input-mask validator should be consistent with this.

Environment


Angular version: 11

Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 12
- Platform:  OSX

Others:
I tried to find a workaround using native inputmask options but was not able to get anything to work.

Parser function not working on latest stable?

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When I update the package to latest 3.0.4, you can see that the Datetime example is not converting to Date object, but simply returning the string value in the inputFormat

Expected behavior

In the original Stackblitz example provided by the readme, we can see the parser function do it's work. But this example is still pointing to an older(?) package "beta".

Minimal reproduction of the problem with instructions

Took the original Stackblitz example, updated the package to v 3.0.4: See updated Stackblitz

Environment


Angular version: 11.0.8


Browser:
- [X] Chrome (desktop) version 95.0.4638.54
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

input-mask on older Angular versions

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[X] Support request
[ ] Other... Please describe:

Current behavior

Is there any available version of input-mask that works fine with Angular 8? Are there any workarounds to make it work on older versions of Angular?

Pressing on K and M doesn't set the control value with the UI value

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Pressing on K and M adds zeros to the UI but not in the control value for currency.

Expected behavior

Pressing on K and M should add zeros to UI and also in the control value for currency.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-ivy-vbpagt

Currency input mask not updating value when user backspaces over cents

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Even in the example at https://github.com/ngneat/input-mask#3-currency, this behavior can be seen.

In my application, for example, the value in the field begins as something like 383.83. If the user goes to the end and backspaces over the 3, a zero replaces it. But then when I check the value, it is still 383.83. When backspacing over digits on the left side of the decimal, the value gets updated. So it's like the trailing zeros aren't recognized until a ones place or higher are updated.

Expected behavior

The value should be updated.

Minimal reproduction of the problem with instructions

Again, you could follow the setup at https://github.com/ngneat/input-mask#3-currency. Currently this looks like:

@Component({
  template: `
    <input
      [inputMask]="currencyInputMask"
      [formControl]="currencyFC"
      placeholder="$ 0.00"
    />
  `,
})
export class AppComponent {
  currencyInputMask = createMask({
    alias: 'numeric',
    groupSeparator: ',',
    digits: 2,
    digitsOptional: false,
    prefix: '$ ',
    placeholder: '0',
  });
  currencyFC = new FormControl('');
}

Update: I added a Stackblitz for simplicity. It's in Angular 14, but the version of Angular is not the issue: https://stackblitz.com/edit/angular-ivy-exhxta?file=src/app/app.component.ts

What is the motivation / use case for changing the behavior?

In any application that deals with currency, every cent matters. If the end user believes they are paying even 1 cent less than they really are, it could cause problems for the consumers of this library.

Environment


Angular version: 13.0.4


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

I also want to say I switched from another library to this one for masking currency because the other masking library refused to display trailing zeros at all, so you guys are already a leg up on them. Thank you!

Emit a phantom value on start

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Form control with mask, emit phantom value (check console.log in stackblitz link)

Angular v13 with @ngneat/[email protected] - https://stackblitz.com/edit/angular-ivy-vpnlko
Angular v11 with @ngneat/[email protected] - https://stackblitz.com/edit/angular-ivy-aq5gkw

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Disabled state is not honored

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

It is possible to enter a value in a disabled input.

Expected behavior

It should not be possible to enter value in a disabled input.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-ogfsyp

What is the motivation / use case for changing the behavior?

Standard behavior

Environment

Angular CLI: 13.0.2
Node: 14.16.1
Package Manager: yarn 1.22.4
OS: win32 x64

Angular: 13.0.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.2
@angular-devkit/build-angular   13.0.2
@angular-devkit/core            13.0.2
@angular-devkit/schematics      13.0.2
@angular/cli                    13.0.2
@schematics/angular             13.0.2
rxjs                            7.4.0
typescript                      4.4.4

Browser:
- [x] Edge version 95
 
For Tooling issues:
- Node version: 14.16
- Platform:  Windows 

Support for angular 12

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Unable to install on an angular 12 app by running ng add @ngneat/input-mask with following error message:

npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~12.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^11.2.7" from @ngneat/[email protected]

Expected behavior

Successfull install

Minimal reproduction of the problem with instructions

update angular cli and create an empty project using the cli and run ng add @ngneat/input-mask

What is the motivation / use case for changing the behavior?

I would like to use your plugin in an angular 12 app.

Environment


Angular version: 12.1.5


Browser:
- [x] Chrome (desktop) version XX
- [x] Chrome (Android) version XX
- [x] Chrome (iOS) version XX
- [x] Firefox version XX
- [x] Safari (desktop) version XX
- [x] Safari (iOS) version XX
- [x] IE version XX
- [x] Edge version XX
 
For Tooling issues:
- Node version: v16.1.0  
- Platform:  Mac 

Mask is not working for textarea element

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When set a mask into a textarea, mask does not work

Expected behavior

Masks are working for textarea as it is for input

Minimal reproduction of the problem with instructions

Repro with angular and ngneat/inputmask: If you type in the input, you will notice mask works fine, but if you try to type into textarea, it does not
https://stackblitz.com/edit/angular-ivy-avdfne

Using inputmask without angular: Mask works for both, input and textarea
https://stackblitz.com/edit/web-platform-d3xaxw

What is the motivation / use case for changing the behavior?

Its supported on https://github.com/RobinHerbots/Inputmask#allowed-html-elements

Environment


Angular version: 14.0.0


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Validators fails in a specific case

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

First of all, sorry for the elusive title but I couldn't come up with a meaningful one that does not take 3 lines of text :-)

Second, I could explain the issue but I think a StackBlitz will be clearer: https://stackblitz.com/edit/angular-uysvv8

Start by entering a number that satisfies the input in the textbox, hit "Switch" and re-enter a number.
As you will see, when you enter the number the first time, the validator of input-mask works as expected.
However, when you enter the number a second time, the validator says that the value is not correct while it is;

image

The code might seem weird but I'm using a similar one in the form I'm creating.
Basically, the form contains two parts but only one of them is visible depending on the value of a radio button.
However, these two parts ask to the user to enter the same field which an input mask is applied to, so in the case the user enters the value and changes the value of the radio button, the other part appears but then the input mask validation fails.

Expected behavior

The validator of the input mask should validate the value correctly.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-uysvv8

Environment

Angular CLI: 13.0.2
Node: 14.16.1
Package Manager: yarn 1.22.4
OS: win32 x64

Angular: 13.0.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.2
@angular-devkit/build-angular   13.0.2
@angular-devkit/core            13.0.2
@angular-devkit/schematics      13.0.2
@angular/cli                    13.0.2
@schematics/angular             13.0.2
rxjs                            7.4.0
typescript                      4.4.4

Browser:
- [x] Edge version 95
 
For Tooling issues:
- Node version: 14.16
- Platform:  Windows 

`FormControl<Date>` emits empty string

I'm submitting a...


[ ] Regression (a behaviour that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behaviour

When the input is clear, an empty string value is emitted rather than null.

formControlWithMask = new FormControl<Date>(null);

ngOnInit(): void {
  this.formControlWithMask.valueChanges
    .pipe(
      untilDestroyed(this),
      filter((value) => (value as any) === ''),
      tap(() => console.error('empty string value detected'))
    )
    .subscribe();
}

Expected behaviour

As a control of type FormControl<Date>, I expect it to never emit an empty string value.
Instead, I think that it should emit a null value.

Minimal reproduction of the problem with instructions

Please find a reproduction of the problem here: https://stackblitz.com/edit/angular-ivy-nbq2kq

  1. Focus the date input
  2. Type "17"
  3. Clear the input
  4. Check that an empty string is emitted (by means of the console logs)

What is the motivation / use case for changing the behaviour?

Users may use formControl.valueChanges as an Observable<Date> (as it should be),
so it could lead to errors such as https://stackoverflow.com/questions/54462227/rangeerror-invalid-time-value

Environment


Angular version: 14.2.1


Browser:
- [x] Chrome (desktop) version 105.0.5195.102
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 18.7.0
- Platform: Windows 10

Others:

Label asterisk (Required)

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

The Label with (*) for fields required is not showing

Expected behavior

Show Label with (*) for fields required

Minimal reproduction of the problem with instructions

image

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ x ] Chrome (desktop) version XX
- [ x ] Chrome (Android) version XX
- [ x ] Chrome (iOS) version XX
- [ x ] Firefox version XX
- [ x ] Safari (desktop) version XX
- [ x ] Safari (iOS) version XX
- [ x ] IE version XX
- [ x ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Error building SSR application with input-mask imported - self is not defined

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When trying to build my SSR application, I get the following error returned:

/Users/asitha/xxx/public/dist/xxx/server/main.js:125172
}(self, function () {
  ^

ReferenceError: self is not defined
    at Object.43641 (/Users/asitha/xxx/public/dist/xxx/server/main.js:125172:3)
    at /Users/asitha/xxx/public/dist/xxx/server/main.js:207873:39
    at Function.proto.<computed> (/Users/asitha/xxx/public/dist/xxx/server/main.js:205816:18)
    at __webpack_require__ (/Users/asitha/xxx/public/dist/xxx/server/main.js:470193:42)
    at Module.2105 (/Users/asitha/xxx/public/dist/xxx/server/main.js:448037:67)
    at /Users/asitha/xxx/public/dist/xxx/server/main.js:207873:39
    at Function.proto.<computed> (/Users/asitha/xxx/public/dist/xxx/server/main.js:205816:18)
    at __webpack_require__ (/Users/asitha/xxx/public/dist/xxx/server/main.js:470193:42)
    at Module.40228 (/Users/asitha/xxx/public/dist/xxx/server/main.js:2251:76)
    at /Users/asitha/xxx/public/dist/xxx/server/main.js:207873:39

Looking into that line of code, I see that it was the inputmask that in the dist file that was causing the issue:

/*!**************************************************!*\
  !*** ./node_modules/inputmask/dist/inputmask.js ***!
  \**************************************************/
/***/ ((module) => {

/*!
 * dist/inputmask
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2021 Robin Herbots
 * Licensed under the MIT license
 * Version: 5.0.7
 */
!function (e, t) {
  if (true) module.exports = t();else { var a, i; }
}(self, function () {
  return function () {
    "use strict";

I attempted to do the isPlatformBrowser check before calling createMask but the only way to fix it was to not import the module at all within the application. Also attempted to install the beta version of this package, but that didn't work either.

Expected behavior

Able to build application with the package included in the imported modules.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: 14.2.7
    "@angular/animations": "^14.2.7",
    "@angular/cdk": "14.2.5",
    "@angular/common": "^14.2.7",
    "@angular/compiler": "^14.2.7",
    "@angular/core": "^14.2.7",
    "@angular/fire": "7.4.1",
    "@angular/flex-layout": "^14.0.0-beta.41",
    "@angular/forms": "^14.2.7",
    "@angular/material": "14.2.5",
    "@angular/platform-browser": "^14.2.7",
    "@angular/platform-browser-dynamic": "^14.2.7",
    "@angular/platform-server": "^14.2.7",
    "@angular/router": "^14.2.7",
    "@fortawesome/angular-fontawesome": "^0.11.0",
    "@fortawesome/fontawesome-svg-core": "^6.1.1",
    "@fortawesome/free-regular-svg-icons": "^6.1.1",
    "@fortawesome/free-solid-svg-icons": "^6.1.1",
    "@ngneat/input-mask": "^5.3.0-beta.1",

For Tooling issues:
- Node version: 16  
- Platform:  Mac

Others:

Dynamically changing [inputMask] variable not updating input

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Whenever I update the variable bound to the [inputMask] directive, it is not updating the actual mask on the input

Expected behavior

Expect that when I make changes to the variable it would actually update the mask that is being used on the input.

Minimal reproduction of the problem with instructions

Created a Reproduction on Stackblitz you can see whenever you try to change the [inputMask]="textInputMask" it will not update the mask for the input. Only when you enable the work-around in the .ts file. You will see I force the refresh of the input to make it actually work.

What is the motivation / use case for changing the behavior?

Would make sense to listen for @ Input variables

Environment


Angular version: 11.2.13

Browser:
- [x] Chrome (desktop) version 95.0.4638.69
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

datetime input mask makes assumptions about year

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:

Current behavior

A datetime input mask with inputFormat: 'datetime' autocompletes the year for a user after they type the first two digits if the first two digits are 20.

// user inputs "062220"
    public dateInputMask = createMask<Date>({
        alias: 'datetime',
        inputFormat: 'mm/dd/yyyy',
        placeholder: 'MM/DD/YYYY',
        parser: (value: string) => {
            // value is "06/22/2023"
            const values = value.split('/');
            const month = +values[0] - 1;
            const date = +values[1];
            const year = +values[2];

            return new Date(year, month, date);
        },
        formatter: (value: Date | string) => {
            return formatDate(value, 'MM/dd/yyyy', 'en-US');
        }
    });

Expected behavior

The input mask shouldn't assume what the user will type. This interferes with onChange validation. Given the example above, the value should be 06/22/20yy with a user input of 062220

Minimal reproduction of the problem with instructions

Visit the stackblitz and enter 06/22/20 to repro
https://stackblitz.com/edit/angular-kfzzet?file=src%2Fmain.ts

What is the motivation / use case for changing the behavior?

Environment


Angular version: 16.1.2


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 18.x  
- Platform:  StackBlitz, Windows

Others:

Error In Validate Function

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behaviour

The validate function returns { inputMask: true } when this.inputMaskPlugin is undefined. When using nested inputs / controls this can become an issue as the validation switches states as the inputmask is created.

This gives the error "Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value for 'invalid': 'null'. Current value: '[object Object]'."

Expected behavior

The control should not be marked as invalid when it is not.

Current Code

validate(control) {
  return !control.value || (this.inputMaskPlugin && this.inputMaskPlugin.isValid())
  ? null
  : { inputMask: true };
}

Proposed Code

validate(control) {
  return !control.value || !this.inputMaskPlugin || this.inputMaskPlugin.isValid()
  ? null
  : { inputMask: true };
}

Here I am logging the error state as the components are created. You can see the null switches to { inputMask: true } before switching back to null. This is what causes the error to be shown.

Screenshot 2021-10-27 at 16 21 52

Input Mask blocking value/validity update of formControl with Option updateOn: 'blur'

I'm submitting a...

  • Regression (a behavior that used to work and stopped working in a new release)

  • Bug report

  • Performance issue

  • Feature request

  • Documentation issue or request

  • Support request

  • Other... Please describe:

Current behavior

Inputmask does not update value if formControl is configured with { updateOn: 'blur' } (AbstractControlOptions}

Expected behavior

Inputmask should update value with updateOn blur behavior.

Minimal reproduction of the problem with instructions

The gist: The InputMaskDirective does not

  1. implement HostListener for the blur event

  2. register any callback in the registerOnTouched Hook

So it just does nothing on blur event, because the callback defined in the registerOnTouched hook is never called. Heavily inspired by the logic you implemented for the input change event, we tried the following in our team and it seems to work:

  @HostListener('blur', ['$event.target.value'])

  onBlur = (_: any): void => {

  };

  registerOnTouched(fn: any): void {

    const parser = this.inputMask.parser;

    this.onBlur = (value): void => {

      fn(parser ? parser(value) : value);

    };

  }

If you want to, I can submit a PR including some Tests for it (which I did not write yet).

What is the motivation / use case for changing the behavior?

The InputMask is not usable with onBlur behavior.

Environment

Angular version: 11.2.14

I did not, but I'm pretty sure it would occur the same.

Browser:

  • Chrome (desktop) version 90.0.4430.85

  • Chrome (Android) version XX

  • Chrome (iOS) version XX

  • Firefox version XX

  • Safari (desktop) version XX

  • Safari (iOS) version XX

  • IE version XX

  • Edge version XX

Bug: Input is not working with [email protected]

I'm submitting a...

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report
  • Performance issue
  • Feature request
  • Documentation issue or request
  • Support request
  • Other... Please describe:

Current behavior

Number is not correct after input.

Minimal reproduction of the problem with instructions

See Stackblitz:
https://stackblitz.com/edit/input-mask-dywitom-zf1ljc

Environment

Angular version:


"dependencies": {
    "@angular/animations": "^14.2.7",
    "@angular/cdk": "^14.2.5",
    "@angular/common": "^14.2.7",
    "@angular/compiler": "^14.2.7",
    "@angular/core": "^14.2.7",
    "@angular/forms": "^14.2.7",
    "@angular/material": "^14.2.5",
    "@angular/material-luxon-adapter": "^14.2.5",
    "@angular/platform-browser": "^14.2.7",
    "@angular/platform-browser-dynamic": "^14.2.7",
    "@angular/router": "^14.2.7",
    "@fullcalendar/web-component": "^6.0.0-beta.1",
    "@ngneat/input-mask": "^5.2.0",
    "hammerjs": "^2.0.8",
    "inputmask": "^5.0.7",
    "luxon": "^2.3.2",
    "rxjs": "^7.5.7",
    "tslib": "^2.4.0",
    "zone.js": "^0.11.8"
  }

Browser:

  • Chrome (desktop) version latest
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

For Tooling issues:

  • Node version: v16.13.0
  • Platform: Windows

The cursor jumps to the end of the line after changing the mask

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When I change the mask, the cursor jumps to the end of the line.

Expected behavior

Ideally, the cursor should stay in the same position.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-5p7fvw?file=src/main.ts

Reproduction: Go the the website above and try to type 12. Then move the cursor to the beginning and type 3.

Current behavior: The cursor jumps to the end of the line just after 2.

Expected behavior: The cursor should stay just after 3.

What is the motivation / use case for changing the behavior?

Let's say that you want to mask a credit card number. You can detect a credit card type and therefore apply an appropriate mask. Unfortunately, when I change the mask, the cursor jumps to the end of the line which can be confusing.

Environment

Angular version: 15.2.5

Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version XX
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [x] Edge version XX
 
For Tooling issues:
- Node version: 18.4.0
- Platform:  Mac

Do you have any recommendation how to mitigate this problem?

Cursor jumps on first digit

I'm submitting a bug


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Cursor jumps to the right of the first numeric position, when having a groupSelector set.

Example:
b9cbee73-b120-4b39-be65-2fbe19e7268f

Expected behavior

Cursor should be positioned to the left of the first numeric position.

Minimal reproduction of the problem with instructions

(see gif above)

Environment

https://stackblitz.com/edit/angular-ivy-ikuzc4?file=src%2Fapp%2Fapp.component.ts

Browser:
Every browser

Initialized form does not show the value

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ X ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

I am not able to initialize a formControl with a value.
I don't know if I am doing right but the form control stays empty after form initialization.

https://stackblitz.com/edit/angular-inputmask-neat?file=src/app/app.component.ts

Expected behavior

If I have a formControl field = new FormControl('5/10') that fits the input mask pattern, it needs to be populated.


Angular version: 12

Browser:
- [ X ] Chrome (desktop) version 91
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ X ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Cut & paste problem

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

If u write a value with inputMask and 'cut' this value with ctrl/cmd + x then the value that is cut is not passed to the clipboard. This case work in main package based on JS.
This bug occurs in 4.x and 5.x version of this library.

Angular v13 with @ngneat/[email protected] - https://stackblitz.com/edit/angular-ivy-vpnlko
Angular v11 with @ngneat/[email protected] - https://stackblitz.com/edit/angular-ivy-aq5gkw

Expected behavior

In clipboard u have a cutted value from input with mask

Minimal reproduction of the problem with instructions

  1. Write a value, like 111.111.111
  2. Cut this value from input with mask (ctrl/cmd+x)
  3. Try paste this value in input with mask
  4. Value is not pasted

What is the motivation / use case for changing the behavior?

Environment


Angular version: x.x.x


Browser:
- [] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

FormControl valueChanges not triggered when pasting value

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Whenever I paste a value to an input that has the [inputMask] directive, the related [formControl] is not emitting the .valueChanges event.

Expected behavior

When I actually remove the [inputMask] on that input, I can actually see this working normally, so this seem to be caused by the [inputMask] directive

Minimal reproduction of the problem with instructions

See reproduction on StackBlitz. Try to enter any value in the "Input" field, notice that there are console logs. Now try to paste some value in that input like "123", notice there is no console log, there was no event emitted to valueChanges.

Try to remove the [inputMask] on the and you should see it actually does a console log when pasting values.

What is the motivation / use case for changing the behavior?

Should work as a normal FormControl

Environment


Angular version: 11.2.13


Browser:
- [ ] Chrome (desktop) version 95.0.4638.69
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Add missing "alias" documentation

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

What is the motivation / use case for changing the behavior?

Can't find any documentation about alias:
What's its purpose?
List of available alias?

Date mask doesn't work

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Create a date mask on a simple control in a component. The mask shows really weird stuff when you hover or click on it.
image

Expected behavior

The mask works correctly.

Minimal reproduction of the problem with instructions

Create a date mask on a simple control in a component.

Environment


Angular version: 12.2.14

Browser:
- [ x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 16.13.0
- Platform: Windows

Others:
ngx-bootstrap is installed as well, they may be interfering with each other in some way

Input is empty when provide FormControl value

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

A form control does not show its value when an input mask is applied

Expected behavior

The form control should continue to display its value

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-ivy-mjxupg?file=src/app/app.component.ts
Load the stackblitz.
Notice that the input element does not show any value

input is empty

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

This is a fork of the Stackblitz demo. It also depends on angular 11.   I'm new to angular so I may be doing something wrong.

Initial FormGroup values are not populated When Mask Applied

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behaviour

Initial value does not populate input when set in new FormGroup

ipAddress: new FormControl('111.111.111.111') should set the input

Expected behavior

Input should be set if initial value in FormControl is set

Minimal reproduction of the problem with instructions

https://angular-ivy-qmkrmw.stackblitz.io

What is the motivation / use case for changing the behaviour?

So it works like a standard FormControl

Environment


Angular version: 12.2


Browser:
- [ ] Chrome (desktop) version XX
- [x] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  Mac

Others:

Update to Angular v13

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Library doesn't support Angular v13.

Expected behavior

Library should support Angular v13.

What is the motivation / use case for changing the behavior?

Keeping up with latest Angular versions.

Custom component (ionic) support

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:

Current behavior

TypeError: Cannot read property 'charAt' of undefined

Expected behavior

Being able to use a mask on custom/wrapper components (ionic) ion-input.

Minimal reproduction of the problem with instructions

numericMask = createMask({ alias: 'numeric' });

<ion-input
          type="password"
          inputmode="tel"
          clearInput="true"
          minlength="4"
          maxlength="10"
          [inputMask]="numericMask"
        ></ion-input>

https://ionic-qesceu.stackblitz.io/

What is the motivation/use case for changing the behavior?

Not really a change of behavior but more of a feature request (if not currently implemented)

Environment

Ionic:

   Ionic CLI                     : 6.17.0 (/Users/jonathan/.nvm/versions/node/v16.4.2/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.11
   @angular-devkit/build-angular : 12.0.3
   @angular-devkit/schematics    : 12.0.3
   @angular/cli                  : 12.0.3
   @ionic/angular-toolkit        : 4.0.0

Angular version: 12.0.3


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 16.4.2  
- Platform:   Mac


Others: Here is a library that supports it but isn't maintained anymore

Unable to prevent paste event

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report 
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When I try to prevent the paste event by for example calling event.preventDefault() on it or by doing (paste)="(false)" it doesn't work with input-mask. I can still paste text into the input from the clipboard with ctrl+v.

Expected behavior

The mask shouldn't make it unable to prevent the paste event.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-ivy-prufpu?file=src/app/app.component.html

Environment


Angular version: 14.1.0


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: v18.12.1  
- Platform:  Windows 10 

Others:

groupSeparator NOT WORKING

groupSeparator NOT WORKING

And how can I change decimal separator?

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Screen Shot 2022-05-15 at 13 27 03

Initial `FormControl<Date>` is invalid

I'm submitting a...


[ ] Regression (a behaviour that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behaviour

At the initialization of my FormControl<Date>, I expect it to be valid.
It is not the case, unlike when I'm not using @ngneat/input-mask.

In particular, there are two usecases:

  1. When the form value is initialized with a null value, the form has the error { "matDatepickerParse": { "text": "" } }
  2. When a default date value is set after some time, the form has the error { "matDatepickerParse": { "text": "dd/mm/yyyy" } }

image

Expected behaviour

I expect my form control to have no error, just like when there is no use of @ngneat/input-mask.

Minimal reproduction of the problem with instructions

Please find a reproduction of the problem here: https://stackblitz.com/edit/angular-ivy-8fcojb

For the usecase 1, just compare the form control with mask with the one without mask.
For the usecase 2, just press the button "Inject defaults" and again compare the two forms.

In both cases, the forms should be valid.

What is the motivation / use case for changing the behaviour?

Business usecase: my users may navigate to a form page with optional date fields.
Some of those date fields may be pre-filled with default values.
I expect them to be able to submit a valid form, which is not possible with the use of @ngneat/input-mask.

Additional information

When I modify the form value through the UI and I come back to the default value, then the error disappears.

Workaround:

@ViewChild('dateInputElement')
private readonly input?: ElementRef<HTMLInputElement>;

ngAfterViewInit(): void {
  this.input?.nativeElement.dispatchEvent(new Event('input'));
}

Environment


Angular version: 14.2.1


Browser:
- [x] Chrome (desktop) version 105.0.5195.102
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 18.7.0
- Platform: Windows 10

Others:

Initial date not selected

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

If adding a mask, and opening the dropdown-calendar, the initial date is not selected automatically

Expected behavior

for example:
typescipt:
public pickervalue:string = "2023-12-10"
now using ngmodel to bind the pickervalue to the input.

Now running the app. The value is displayed in the input. Now opening the calender popup. The date of the model is not selected (but today seems to be selected).

If you just remove the input mask, the control is working as expected.

If you select a date with the datepicker an reopen the popup, the new value is selected (as expected for the first time)

chrome_f4DQu1Kvh3.mp4

Minimal reproduction of the problem with instructions

You can find a small demo here: https://github.com/Micha10/noinitdatewithmask

What is the motivation / use case for changing the behavior?

If there's an initial value and you just open the popup calender, the date should be selected as wiithout inputmask

Environment


Angular version: 15+

Browser:
- [x] Chrome (desktop) version latest
- [x] Firefox version latest
 
For Tooling issues:
- Node version: 18.16
- Platform:   Windows 

NG0303: Can't bind to 'inputMask' since it isn't a known property of 'input' (used in the 'xyz' component template).

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Input mask does not bind to input elements. I have multiple projects using @neat/input-mask successfully. This is my first attempt at using it in an Ionic project.

Expected behavior

I am expecting the [inputMask]="someInputMask" to work as it does in my other project.

Minimal reproduction of the problem with instructions

  1. In a new Angular/Ionic/Capacitor project: ng add @ngneat/input-mask;
  2. verify app.modules.ts import: { InputMaskModule } from '@ngneat/input-mask';
  3. verify app.modules.ts import declaration: imports: [InputMaskModule]
  4. verify app.component.ts import: import { createMask } from '@ngneat/input-mask';
  5. create mask in app.component.ts: this.phoneInputMask = createMask('(999) 999-9999');
  6. bind in app.component.html: <input [inputMask]='phoneInputMask' formControlName="phone" required>
  7. receive error in app.component.html: Can't bind to 'inputMask' since it isn't a known property of 'input'

Environment


Ionic 6.20.1
Capacitor 4.1.0
Angular version: 14.2.0

@angular-devkit/architect       0.1402.1
@angular-devkit/build-angular   14.2.1
@angular-devkit/core            14.2.1
@angular-devkit/schematics      14.2.1
@angular/cli                    14.2.1
@angular/fire                   7.4.1
@angular/google-maps            14.2.2
@schematics/angular             14.2.1
rxjs                            6.6.7
typescript                      4.7.4


Browser:
- [X] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [X] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 14.8.2  
- Platform:  Macos

Others:
- Microsoft VS Code

input_mask_binding

datetime JIT Masking - is it possible to change de letters dd/mm/yyyy?

Discussed in #93

Originally posted by felipein March 18, 2023
Hi,
My scenarios is quite simple: just have a form control input form control and i have applied a date input mask to it with:

dateInputMask = createMask<Date>({ alias: 'datetime', inputFormat: 'dd/mm/yyyy', jitMasking:true, showMaskOnHover: false, showMaskOnFocus: true, parser: (value:string)=>{ const values = value.split('/'); const year = +values[2]; const month = +values[1] - 1; const day = +values[0]; return new Date(year, month, day); }, });

recently i've notice that after typing 2 digits for the day the mask shows /m [end result is something like 01/m ] in the control and after typing the third digit, which is the first digit of the month, the /m dissapear and the control and mask return to work as expected.

It looks like a bug and i found that setting jitmask would avoid this behaviour and i could use it as a workaround to avoid the /m.

now to the point. my culture is aaaa for year the jitmask work as dd/mm/yyyy. Is it possible that i change the jit mask to dd/mm/aaaa?

Chrome Autofill

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When i am using Reactive Forms with the Input Mask and enter for example a E-Mail with the Chrome Autofiller then the Reactive Form does not detect the Value.

When i remove the input mask it does work as expected.

 <input
                                [formControl]="email"
                                required
                                matInput
                                placeholder="[email protected]"
                                [inputMask]="inputMask"
                            />

    emailInputMask = createMask({ alias: 'email' });

Expected behavior

this.form.value
should output the Value of the E-Mail Field.

Minimal reproduction of the problem with instructions

https://codesandbox.io/s/input-mask-autofill-10csi?file=/src/app/app.component.html

add a reactive form and a button to get the value of the reactive form.

What is the motivation / use case for changing the behavior?

UX

Environment

Angular 12

Browser:

  • [ X] Chrome (desktop) version XX
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

For Tooling issues:

  • Node version: 14
  • Platform: Mac

How to make this work with Angular 10.x.x

I'm submitting an issue regarding groupSeparator


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

currencyInputMask = createMask({
alias: 'numeric',
groupSeparator: '.',
radixPoint: ',',
digits: 2,
digitsOptional: false,
prefix: 'Rp',
placeholder: '0,00',
});
this is my config
when I input some numbers, it shows 9999999,99

Expected behavior

9.999.999,99

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: 10.x.x


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Error when reset reactiveform

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When I use inputMask with reactiveForms and I need to reset the form, sometimes I have the error in the image.
To reset the form I simply use form.reset().

1

Environment


Angular version: 12

Browser:
- [X] Chrome (desktop) version 91.0
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 14.17
- Platform:  Windows 

v4: inputmask__WEBPACK_IMPORTED_MODULE_0__ is not a constructor

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

I used to create a mask using this:

public nissMask = createMask('99.99.99-999.99');

It worked very well with the version 3 but since the version 4, I get:

image

Expected behavior

The mask should be applied

Minimal reproduction of the problem with instructions

Simply create a mask using:

public nissMask = createMask('99.99.99-999.99');

Then bind it like this:

<input type="text" [inputMask]="nissMask" formControlName="niss" />

What is the motivation / use case for changing the behavior?

/

Environment


Angular CLI: 13.0.2
Node: 14.16.1
Package Manager: yarn 1.22.4
OS: win32 x64

Angular: 13.0.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.2
@angular-devkit/build-angular   13.0.2
@angular-devkit/core            13.0.2
@angular-devkit/schematics      13.0.2
@angular/cli                    13.0.2
@schematics/angular             13.0.2
rxjs                            7.4.0
typescript                      4.4.4

Browser:
- [x] Edge version 95
 
For Tooling issues:
- Node version: 14.16
- Platform:  Windows 10

Environment

I reverted to v3 and it works (although ng cli tells me to encourage you to migrate to Ivy :-))

How to use with inputmask.phone

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

input-mask works great with the built in aliases, but I am trying to determine how to use the inputmask.phone extension. https://github.com/RobinHerbots/inputmask.phone

I attempted to add the following lines to the module that imports@ngneat/input-mask.

import 'inputmask.phone';
import 'inputmask.phone/dist/inputmask.phone/phone-codes/phone';

The to inputmask.extendAliases call happens, but when the input-mask directive instantiates the new mask, the aliases do not contain the 'phone' alias. I think there must be a timing behavior, but I am unsure.

Expected behavior

I would expect to have a way that I can extend inputmask with alias libraries like inputmask.phon

Minimal reproduction of the problem with instructions

See: https://stackblitz.com/edit/input-mask-phone-alias?file=src/app/app.component.ts

What is the motivation / use case for changing the behavior?

I would like to allow the use of international phone number masks.

Environment

Used a fork of the current @ngnest/input-mask stackblitz example.


Angular version: 11.2.14


Browser:
- [X] Chrome (desktop) version 94
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 14.18.1
- Platform:  Linux

Others:

Deleting last digit after the decimal in a numeric input does not update the form value

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When I tab to an input with decimal places and delete the last digit using the backspace key, the model value is not updated

Expected behavior

The model value should update whenever the value in the input changes

Minimal reproduction of the problem with instructions

Create a numeric mask with decimal places and apply to to an input on a form.

  1. Input some number, like 123.45.
  2. tab off the input and then tab back.
  3. use arrow keys to get to the right of the input
  4. use backspace to delete the last digit
  5. tab off of the input
    ( note that the value does not change, even when the last digit is removed )

See the following stackblitz.
https://stackblitz.com/edit/angular-ivy-bac522?file=src/app/app.component.ts

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

This is a fork of the stackblitz demo
![bug-report-decimal](https://user-images.githubusercontent.com/4500785/135702122-c6ccc80d-d0b4-4836-8776-cdb46de76d55.gif)

Can't install in angular version 11.2.13

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[X] Other... Please describe: Installation problem

Current behavior

When installing with ng add @ngneat/input-mask

i get the next log

Using package manager: yarn
โœ” Found compatible package version: @ngneat/[email protected].
โœ” Package information loaded.
โœ” Package successfully installed.
โœ…๏ธ Added "inputmask
โœ…๏ธ Added "@types/inputmask
๏ฟฝ Installing packages...
Cannot read property 'kind' of undefined

after the undefined the instalation doesn't continue, if i install it manualy, it says this

@ngneat/[email protected]" has unmet peer dependency "inputmask@^5.0.5". and doing ng serve, it throws this error
An unhandled exception occurred: The target entry-point "@ngneat/input-mask" has missing dependencies:

  • inputmask

[error] Error: The target entry-point "@ngneat/input-mask" has missing dependencies:

  • inputmask

    at TargetedEntryPointFinder.findEntryPoints (C:\user\node_modules@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
    at K:\kordataCliente\node_modules@angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:29:41
    at SingleProcessExecutorSync.SingleProcessorExecutorBase.doExecute (C:\user\node_modules@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:28:29)
    at K:\kordataCliente\node_modules@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:59
    at SyncLocker.lock (C:\user\node_modules@angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
    at SingleProcessExecutorSync.execute (C:\user\node_modules@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
    at Object.mainNgcc (C:\user\node_modules@angular\compiler-cli\ngcc\src\main.js:74:25)
    at Object.process (C:\user\node_modules@angular\compiler-cli\ngcc\index.js:29:23)
    at NgccProcessor.processModule (C:\user\node_modules@ngtools\webpack\src\ngcc_processor.js:163:16)
    at K:\kordataCliente\node_modules@ngtools\webpack\src\ivy\host.js:109:18
    at K:\kordataCliente\node_modules@ngtools\webpack\src\ivy\host.js:39:24
    at Array.map ()
    at Object.host.resolveModuleNames (C:\user\node_modules@ngtools\webpack\src\ivy\host.js:37:32)
    at actualResolveModuleNamesWorker (C:\user\node_modules\typescript\lib\typescript.js:102904:133)
    at resolveModuleNamesWorker (C:\user\node_modules\typescript\lib\typescript.js:103126:26)
    at resolveModuleNamesReusingOldState (C:\user\node_modules\typescript\lib\typescript.js:103200:24)

Expected behavior

I want get installed with this version

Minimal reproduction of the problem with instructions

"@angular/core": "^11.2.13"
ng add @ngneat/input-mask

What is the motivation / use case for changing the behavior?

Environment


Angular version: 11.2.13

With Google board in android, input-mask is duplicating some characters introduced by user

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report 
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

In an adnroid using Google Board and Chrome (96) with a mask using ('aa99 9999') as mask, it will duplicate the 5th character introduced by the user

Expected behavior

It should not duplicate the 5th character.

Minimal reproduction of the problem with instructions

When using chrome on android, if using 'aa99 9999 9999 9999 9999 99' as a Mask, when introducing the 5th character, it auto duplicates it.
Only being able to reproduce with android devices using Google Board. i.e: Won't happen with SwiftKey Keyboard

https://stackblitz.com/edit/angular-ivy-qzy73n?file=src%2Fapp%2Fapp.component.html
Open the link from the device matching the browser and keyboard and reproduce.

Environment


Angular version: Reproduced in both Angular 12 and Angular 11

Browser:
- [ ] Chrome (desktop) version XX
- [X] Chrome (Android) version 96 (Android 11)
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 

Bug: Value stays negative after mark and replace

I'm submitting a...

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report
  • Performance issue
  • Feature request
  • Documentation issue or request
  • Support request
  • Other... Please describe:

Current behavior

  • Write a positive number
  • Press -
  • Mark the whole number
  • Write a new number
  • Bug: Value stays negative

Minimal reproduction of the problem with instructions

See Stackblitz:
https://stackblitz.com/edit/input-mask-dywitom-wgx7sa

Environment

Angular version:


"dependencies": {
    "@angular/animations": "^14.2.7",
    "@angular/cdk": "^14.2.5",
    "@angular/common": "^14.2.7",
    "@angular/compiler": "^14.2.7",
    "@angular/core": "^14.2.7",
    "@angular/forms": "^14.2.7",
    "@angular/material": "^14.2.5",
    "@angular/material-luxon-adapter": "^14.2.5",
    "@angular/platform-browser": "^14.2.7",
    "@angular/platform-browser-dynamic": "^14.2.7",
    "@angular/router": "^14.2.7",
    "@fullcalendar/web-component": "^6.0.0-beta.1",
    "@ngneat/input-mask": "^5.2.0",
    "hammerjs": "^2.0.8",
    "inputmask": "^5.0.5",
    "luxon": "^2.3.2",
    "rxjs": "^7.5.7",
    "tslib": "^2.4.0",
    "zone.js": "^0.11.8"
  }

Browser:

  • Chrome (desktop) version latest
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

For Tooling issues:

  • Node version: v16.13.0
  • Platform: Windows

Angular mat-datePicker missing event dateChange

I'm submitting a bug


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

If using inputmask with a mat-datepicker, the event (dataChange) is not sent when leaving the control (blur)

Expected behavior

Ability to receive the same messages as without inputmask

Minimal reproduction of the problem with instructions

https://stackblitz.com/github/Micha10/input-mask

Please open the console.

Input a date in the first datepicker (i.e 01.01.2022). Each letter will post an entry in the console (input1). If you leave the control with tab, (change1) will be shown.

Now do the same with the second control, the one with a mask. If the entered text is a date (input2) is shown.

But if you leave the control with tab, (change2) is missing.


<mat-form-field>
    <input matInput [matDatepicker]="picker1" placeholder="Choose a date" [ngModel]="date1"
             (dateInput)="addEvent('input1', $event)" (dateChange)="addEvent('change1', $event)"
    >
    <mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
    <mat-datepicker #picker1></mat-datepicker>
  </mat-form-field>
<input matInput [matDatepicker]="picker2" placeholder="Choose a date" [ngModel]="date2"
           [inputMask]="dateInputMask"  (dateInput)="addEvent('input2', $event)" (dateChange)="addEvent('change2', $event)"
    >
  addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
    console.log((`${type}: ${event.value}`));
  }

Environment


Angular version: 15.2.9

Browser:
- [x] Chrome (desktop) version 113.0.5672
- [X] Librewolf version 111.0.1-1
 
For Tooling issues:
- Platform:   Windows 

Drag&Drop paste issue

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

If u try select a value in other window or something then try to drag and drop this value in input with mask, this value is not pasted, but without inputMask library the value is pasted.

Angular v13 with @ngneat/[email protected] - https://stackblitz.com/edit/angular-ivy-vpnlko
Angular v11 with @ngneat/[email protected] - https://stackblitz.com/edit/angular-ivy-aq5gkw

Expected behavior

Drag&Drop a value in input with mask should update formControl

Minimal reproduction of the problem with instructions

drag-drop-problem

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.