v1.7.2: Zeiteingabe – Startzeit leer, Endzeit vorbelegt und fokussiert
- Startzeit startet leer (manuelle Eingabe erforderlich) - Endzeit startet mit aktueller Uhrzeit auf 5 Minuten aufgerundet - Endzeit erhält Autofokus beim Laden des Formulars - Startzeit synct Endzeit nicht mehr automatisch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ interface Props {
|
||||
onChange: (value: string) => void;
|
||||
className?: string;
|
||||
clearOnFocus?: boolean;
|
||||
autoFocus?: boolean;
|
||||
}
|
||||
|
||||
function isValid(t: string): boolean {
|
||||
@@ -20,7 +21,7 @@ function normalize(t: string): string {
|
||||
return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
export default function TimeInput({ value, onChange, className = '', clearOnFocus = false }: Props) {
|
||||
export default function TimeInput({ value, onChange, className = '', clearOnFocus = false, autoFocus = false }: Props) {
|
||||
const [local, setLocal] = useState(value);
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
@@ -71,6 +72,7 @@ export default function TimeInput({ value, onChange, className = '', clearOnFocu
|
||||
onChange={(e) => handleChange(e.target.value)}
|
||||
onFocus={handleFocus}
|
||||
onBlur={handleBlur}
|
||||
autoFocus={autoFocus}
|
||||
placeholder="HH:MM"
|
||||
maxLength={5}
|
||||
className={`w-full px-2 py-1 border-2 rounded-lg bg-white text-sm text-gray-900 font-mono text-center focus:outline-none ${
|
||||
|
||||
Reference in New Issue
Block a user