Open akvaliya opened 4 years ago
That is because angular probably acts on the input event.
ngAfterViewInit() {
this.zone.runOutsideAngular(() => {
Inputmask("datetime", { inputFormat: "HH:MM", clearIncomplete: true, clearMaskOnLostFocus: false,
onincomplete: function(){
Inputmask.dependencyLib(this).trigger("input");
} }).mask(document.querySelectorAll("input[data-inputmask]"));
});
@RobinHerbots
That is because angular probably acts on the input event.
ngAfterViewInit() { this.zone.runOutsideAngular(() => { Inputmask("datetime", { inputFormat: "HH:MM", clearIncomplete: true, clearMaskOnLostFocus: false, onincomplete: function(){ Inputmask.dependencyLib(this).trigger("input"); } }).mask(document.querySelectorAll("input[data-inputmask]")); });
This resolves issue of incomplete value but masking still disappears on click of submit button.
With
clearIncomplete
when mask is incomplete input gets clear but value in form stays like12:4M
withHH:MM
mask.Start typing value & keep input incomplete. Input will be cleared but value in form will stays with mask. Also on click of submit form mask disappears even if
clearMaskOnLostFocus: false
. Click on button & test.