Greg Claude Opus 4.7 (1M context) commited on
Commit
e3aabbe
·
1 Parent(s): ba082ae

fix(schedule): PDF was printing blank due to display:none cascade

Browse files

El wrapper externo del modal tenia .no-print, y la regla
.no-print { display: none !important } lo eliminaba con todos sus
hijos, incluyendo .schedule-print-area. visibility: visible no
puede override display: none de un ancestro.

Cambios:
- Renombrado el outer overlay y el modal box a print-overlay /
print-modal-box (sin no-print). Visibility hidden del body * los
oculta sin removerlos del DOM.
- En print CSS, reseteo de fondo, sombras, max-height y overflow
de esos contenedores para que el grid pueda fluir sin clipping.
- Reforzados los !important en .schedule-print-area para escapar
cualquier overflow/max-height heredado.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

frontend/src/components/ScheduleViewerModal.tsx CHANGED
@@ -40,11 +40,11 @@ export default function ScheduleViewerModal({
40
 
41
  return (
42
  <div
43
- className="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 no-print"
44
  onClick={onClose}
45
  >
46
  <div
47
- className="bg-white rounded-2xl shadow-2xl max-w-5xl w-full max-h-[90vh] flex flex-col"
48
  onClick={(e) => e.stopPropagation()}
49
  >
50
  {/* Modal header — hidden in print */}
 
40
 
41
  return (
42
  <div
43
+ className="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 print-overlay"
44
  onClick={onClose}
45
  >
46
  <div
47
+ className="bg-white rounded-2xl shadow-2xl max-w-5xl w-full max-h-[90vh] flex flex-col print-modal-box"
48
  onClick={(e) => e.stopPropagation()}
49
  >
50
  {/* Modal header — hidden in print */}
frontend/src/styles/global.css CHANGED
@@ -32,21 +32,36 @@
32
  }
33
 
34
  @media print {
35
- /* Hide everything by default */
36
  body * { visibility: hidden; }
37
 
38
  /* Show only the printable grid and its children */
39
  .schedule-print-area,
40
  .schedule-print-area * { visibility: visible; }
41
 
42
- /* Position the print area at the top-left of the page */
43
  .schedule-print-area {
44
- position: absolute;
45
- left: 0;
46
- top: 0;
47
- width: 100%;
 
 
 
48
  }
49
 
50
- /* Hide UI chrome that should be screen-only */
 
 
 
 
 
 
 
 
 
 
 
 
51
  .no-print { display: none !important; }
52
  }
 
32
  }
33
 
34
  @media print {
35
+ /* Hide everything by default via visibility (preserves layout for our absolute positioning) */
36
  body * { visibility: hidden; }
37
 
38
  /* Show only the printable grid and its children */
39
  .schedule-print-area,
40
  .schedule-print-area * { visibility: visible; }
41
 
42
+ /* Position the print area at the top-left of the page, escaping parent constraints */
43
  .schedule-print-area {
44
+ position: absolute !important;
45
+ left: 0 !important;
46
+ top: 0 !important;
47
+ width: 100% !important;
48
+ overflow: visible !important;
49
+ max-height: none !important;
50
+ padding: 0 !important;
51
  }
52
 
53
+ /* Modal overlay/box: kill background-color so they don't tint anything if visibility leaks */
54
+ .print-overlay {
55
+ background: transparent !important;
56
+ position: static !important;
57
+ }
58
+ .print-modal-box {
59
+ background: transparent !important;
60
+ box-shadow: none !important;
61
+ max-height: none !important;
62
+ overflow: visible !important;
63
+ }
64
+
65
+ /* Header/footer buttons of the modal: must NOT render in print */
66
  .no-print { display: none !important; }
67
  }