fix : x (clear) is working
This commit is contained in:
parent
aa1471e89c
commit
c5edb09cd0
@ -240,20 +240,22 @@ export class TouchPadMenuComponent implements OnInit {
|
|||||||
|
|
||||||
enterPadVal(key: string) {
|
enterPadVal(key: string) {
|
||||||
if (!this.numericPadEnabled) return;
|
if (!this.numericPadEnabled) return;
|
||||||
if (/[0-9]/.test(key)) this.padValue += key;
|
|
||||||
else if (key === 'X') this.padValue += 'X';
|
if (key === 'X') {
|
||||||
|
this.padValue = ''; // Clear the pad value
|
||||||
|
} else if (/[0-9]/.test(key)) {
|
||||||
|
this.padValue += key; // Append numeric key
|
||||||
|
}
|
||||||
|
|
||||||
this.updateCanPrint();
|
this.updateCanPrint();
|
||||||
|
|
||||||
const value = parseFloat(this.padValue);
|
const value = parseFloat(this.padValue) || 0;
|
||||||
if (!isNaN(value)) {
|
this.selectionService.updatePartial({
|
||||||
this.selectionService.updatePartial({
|
value,
|
||||||
value,
|
isBoxed: this.isBoxed,
|
||||||
isBoxed: this.isBoxed,
|
label: this.selectedLabel || '',
|
||||||
label: this.selectedLabel || '',
|
numbers: [...this.selectedNumbers]
|
||||||
numbers: [...this.selectedNumbers]
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCanPrint() {
|
updateCanPrint() {
|
||||||
@ -400,4 +402,4 @@ export class TouchPadMenuComponent implements OnInit {
|
|||||||
this.closeFieldModal();
|
this.closeFieldModal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user