I know you can use data-lpignore="true" on an html input to tell LastPass to ignore the field, but is there a way when you're using a 3rd party control where you don't have (easy) access to the underlying input?

1

There are 1 best solutions below

0
On

The best alternative I could come up with in this particular situation is getting a reference to the InputMask using a ViewChild, then during the AfterViewInit event, find that element and add the data-lpignore attribute to its child input.

@ViewChild("myMaskedInput") myMaskedInput?: InputMask;

ngAfterViewInit(): void { 
  this.myMaskedInput.inputViewChild.nativeElement.setAttribute("data-lpignore", "true");
}