Skip to content

Commit ceba0b0

Browse files
arthur-polidorioCSimoesJr
authored andcommitted
fix(input-generic): reseta modelLastUpdate
Reseta modelLastUpdate quando o value é indefinido. Fixes DTHFUI-11447
1 parent 261eb40 commit ceba0b0

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ import { PoModalPasswordRecoveryService } from './po-modal-password-recovery.ser
4646
standalone: false
4747
})
4848
export class PoModalPasswordRecoveryComponent extends PoModalPasswordRecoveryBaseComponent implements OnDestroy {
49-
private router = inject(Router);
50-
private poI18nPipe = inject(PoI18nPipe);
51-
private poModalPasswordRecoveryService = inject(PoModalPasswordRecoveryService);
49+
private readonly router = inject(Router);
50+
private readonly poI18nPipe = inject(PoI18nPipe);
51+
private readonly poModalPasswordRecoveryService = inject(PoModalPasswordRecoveryService);
5252

5353
@ViewChild('emailForm') emailForm: NgForm;
5454

projects/ui/src/lib/components/po-field/po-input-generic/po-input-generic.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,14 @@ describe('PoInputGeneric:', () => {
416416
_formatModel: false
417417
},
418418
change: component.change,
419-
passedWriteValue: false
419+
passedWriteValue: false,
420+
modelLastUpdate: 'oldValue'
420421
};
422+
421423
component.writeValueModel.call(fakeThis, '');
424+
422425
expect(component.inputEl.nativeElement.value).toBe('');
426+
expect(fakeThis.modelLastUpdate).toBe('');
423427
expect(fakeThis.passedWriteValue).toBeTruthy();
424428
});
425429

projects/ui/src/lib/components/po-field/po-input-generic/po-input-generic.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export abstract class PoInputGeneric extends PoInputBaseComponent implements Aft
258258
} else {
259259
// Se o valor for indefinido, deve limpar o campo.
260260
this.inputEl.nativeElement.value = '';
261+
this.modelLastUpdate = '';
261262
}
262263
}
263264

0 commit comments

Comments
 (0)