mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Merged PR 1930: fix(remission-quantity-and-reason-item): correct quantity input binding and d...
fix(remission-quantity-and-reason-item): correct quantity input binding and default value Fix quantity input field binding to use computed quantity signal instead of direct quantityAndReason().quantity, ensuring proper display of undefined values as empty field. Update initial quantity default from 1 to 0 to prevent pre-filled values when creating new quantity/reason items. Also improves placeholder text color contrast by changing from neutral-200 to neutral-500 for better accessibility. Ref: #5292
This commit is contained in:
committed by
Andreas Schickinger
parent
3b0a63a53a
commit
332699ca74
@@ -8,7 +8,7 @@
|
||||
name="quantity"
|
||||
placeholder="Menge eingeben"
|
||||
type="number"
|
||||
[ngModel]="quantityAndReason().quantity"
|
||||
[ngModel]="quantity()"
|
||||
(ngModelChange)="setQuantity($event)"
|
||||
#model="ngModel"
|
||||
[min]="1"
|
||||
@@ -16,7 +16,7 @@
|
||||
required
|
||||
data-what="input"
|
||||
data-which="quantity"
|
||||
class="isa-text-body-2-bold placeholder:isa-text-body-2-regular placeholder:text-isa-neutral-200 text-isa-neutral-900 focus:outline-none w-[9rem] px-4 text-right"
|
||||
class="isa-text-body-2-bold placeholder:isa-text-body-2-regular placeholder:text-isa-neutral-500 text-isa-neutral-900 focus:outline-none w-[9rem] px-4 text-right"
|
||||
/>
|
||||
<ui-dropdown
|
||||
[ngModel]="quantityAndReason().reason"
|
||||
|
||||
@@ -53,6 +53,11 @@ export class QuantityAndReasonItemComponent {
|
||||
},
|
||||
});
|
||||
|
||||
quantity = computed(() => {
|
||||
const quantity = this.quantityAndReason().quantity;
|
||||
return quantity !== undefined && quantity >= 1 ? quantity : undefined;
|
||||
});
|
||||
|
||||
setQuantity(quantity: number): void {
|
||||
this.quantityAndReason.update((qar) => ({
|
||||
...qar,
|
||||
|
||||
@@ -50,7 +50,7 @@ export class SelectRemiQuantityAndReasonComponent {
|
||||
#feedbackDialog = injectFeedbackDialog();
|
||||
host = inject(SearchItemToRemitDialogComponent);
|
||||
|
||||
initialItem: QuantityAndReason = { quantity: 1, reason: '' };
|
||||
initialItem: QuantityAndReason = { quantity: 0, reason: '' };
|
||||
|
||||
quantitiesAndResons = model<QuantityAndReason[]>([this.initialItem]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user