Files
Reactive-Resume/apps
Emran-Y 3e2c991344 fix: clamp page margin values to [0, 100] to prevent crash on paste
When a user pastes a large value (e.g. '1224') into the margin
input field, the value bypasses the HTML <input type='number' max='100'>
and gets stored directly into resume metadata. The PDF renderer then
cannot handle an absurdly large margin, crashing the builder entirely.

This fix adds two layers of defense:
1. Zod schema: add .max(100) to marginX and marginY in pageSchema,
   so any value > 100 is rejected at the validation level.
2. Input handler: clamp the onChange value to [0, 100] so the input
   never even temporarily stores an out-of-range value.

The same pattern can apply to any other numeric inputs that need
a reasonable upper bound.

Fixes: #3263
2026-07-29 15:57:32 +00:00
..