Samenvatting van de fixes:

1. min-w-0 en box-border toegevoegd aan inputClassName en selectClassName - dit voorkomt dat inputs buiten hun
  grid-cellen groeien
  2. overflow-hidden toegevoegd aan de DialogContent - voorkomt dat content buiten de modal zichtbaar is
  3. overflow-hidden toegevoegd aan het form element
  4. Grid layout verbeterd voor datum/tijd: grid-cols-[1fr_auto_auto] met vaste breedte (w-24) voor de tijd inputs,
  zodat de datum meer ruimte krijgt
  5. min-w-0 toegevoegd aan alle grid children voor Type/Locatie

  Deze wijzigingen zorgen ervoor dat:
  - Invoervelden nooit buiten hun containers groeien
  - De modal content netjes binnen de grenzen blijft
  - De datum input meer ruimte krijgt dan de tijd inputs
  - Select dropdowns niet overflow veroorzaken
This commit is contained in:
colinislit
2025-12-03 17:02:27 +01:00
parent f68fc088f7
commit 8e8a8e6f49
3 changed files with 10 additions and 10 deletions

View File

@@ -58,8 +58,8 @@ interface AppointmentModalProps {
onSuccess?: () => void;
}
const inputClassName = "w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-transparent text-sm";
const selectClassName = "w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-transparent text-sm bg-white";
const inputClassName = "w-full min-w-0 px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-transparent text-sm box-border";
const selectClassName = "w-full min-w-0 px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-transparent text-sm bg-white box-border";
const labelClassName = "block text-sm font-medium text-slate-700 mb-1";
export function AppointmentModal({
@@ -416,7 +416,7 @@ export function AppointmentModal({
</DialogTitle>
</DialogHeader>
<form onSubmit={handleSubmit} className="space-y-4 mt-2">
<form onSubmit={handleSubmit} className="space-y-4 mt-2 overflow-hidden">
{/* Patient Search */}
<div className="relative">
<label className={labelClassName}>
@@ -562,8 +562,8 @@ export function AppointmentModal({
)}
{/* Date and Time */}
<div className="grid grid-cols-3 gap-3">
<div>
<div className="grid grid-cols-[1fr_auto_auto] gap-3 items-end">
<div className="min-w-0">
<label className={labelClassName}>
<Calendar className="h-4 w-4 inline mr-1" />
Datum *
@@ -576,7 +576,7 @@ export function AppointmentModal({
required
/>
</div>
<div>
<div className="w-24">
<label className={labelClassName}>
<Clock className="h-4 w-4 inline mr-1" />
Van *
@@ -589,7 +589,7 @@ export function AppointmentModal({
required
/>
</div>
<div>
<div className="w-24">
<label className={labelClassName}>
<Clock className="h-4 w-4 inline mr-1" />
Tot
@@ -605,7 +605,7 @@ export function AppointmentModal({
{/* Type and Location */}
<div className="grid grid-cols-2 gap-3">
<div>
<div className="min-w-0">
<label className={labelClassName}>Type afspraak *</label>
<select
value={typeCode}
@@ -620,7 +620,7 @@ export function AppointmentModal({
))}
</select>
</div>
<div>
<div className="min-w-0">
<label className={labelClassName}>
<MapPin className="h-4 w-4 inline mr-1" />
Locatie

View File

@@ -38,7 +38,7 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
className
)}
{...props}

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB