Fix zu schmale Eingabefelder in Inline-Reihen

Eingaben haben global width:100% und schrumpften im Flex-Layout zusammen
(Mindestbestand-Einheit abgeschnitten, Chargen-Bearbeitung winzig).
- .field-inline: Zahlenfelder wachsen (min 78px), Einheiten-Dropdowns behalten
  ihre Textbreite (min 132px).
- In Tabellenzellen brechen die Felder bei wenig Platz um statt zu quetschen.
- Einengende Inline-maxWidth entfernt; Menge-/MHD-Spalte mit Mindestbreite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-22 13:14:57 +02:00
parent e901e456c1
commit c065b8879d
2 changed files with 17 additions and 7 deletions

View File

@@ -278,7 +278,7 @@ export default function ProductForm() {
<input type="number" step="any" value={form.min_stock}
onChange={(e) => set("min_stock", e.target.value)} disabled={readOnly} placeholder="z.B. 2" />
<select value={minUnit || form.unit_id} onChange={(e) => changeMinUnit(e.target.value)}
disabled={readOnly} style={{ maxWidth: 190, marginTop: 0 }}>
disabled={readOnly} style={{ marginTop: 0 }}>
{units
.filter((u) => !selectedUnit || u.kind === selectedUnit.kind)
.map((u) => <option key={u.id} value={u.id}>{u.name}</option>)}
@@ -411,7 +411,12 @@ function LotsCard({ product, lots, baseShort, warnDays, isAdmin, imageUrl, onCha
<div className="table-wrap">
<table className="table">
<thead>
<tr><th className="num">Menge</th><th>MHD</th><th>Eingelagert</th><th></th></tr>
<tr>
<th className="num" style={{ minWidth: 150 }}>Menge</th>
<th style={{ minWidth: 160 }}>MHD</th>
<th>Eingelagert</th>
<th></th>
</tr>
</thead>
<tbody>
{lots.map((l) => {
@@ -425,10 +430,10 @@ function LotsCard({ product, lots, baseShort, warnDays, isAdmin, imageUrl, onCha
<div className="field-inline" style={{ justifyContent: "flex-end" }}>
<input type="number" step="any" min="0" value={draft.quantity}
onChange={(e) => setDraft({ ...draft, quantity: e.target.value })}
style={{ maxWidth: 90, marginTop: 0 }} />
style={{ marginTop: 0 }} />
{pkgSize > 0 ? (
<select value={editUnit} onChange={(e) => changeEditUnit(e.target.value)}
style={{ maxWidth: 120, marginTop: 0 }}>
style={{ marginTop: 0 }}>
<option value="package">Packung(en)</option>
<option value="unit">{unitName}</option>
</select>
@@ -449,7 +454,7 @@ function LotsCard({ product, lots, baseShort, warnDays, isAdmin, imageUrl, onCha
{editing ? (
<input type="date" value={draft.best_before}
onChange={(e) => setDraft({ ...draft, best_before: e.target.value })}
style={{ maxWidth: 150, marginTop: 0 }} />
style={{ marginTop: 0, minWidth: 150 }} />
) : (
<>
{l.best_before || ""}