@cosxai/ui 0.13.3 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -380,13 +380,24 @@ export const SignaturePad = forwardRef<SignaturePadHandle, SignaturePadProps>(
|
|
|
380
380
|
display: "flex",
|
|
381
381
|
flexDirection: "column",
|
|
382
382
|
gap: 8,
|
|
383
|
+
// fit-content sizes to the canvas's intrinsic `width` prop —
|
|
384
|
+
// which is exactly what overflowed narrow phones: the wrapper
|
|
385
|
+
// itself grew to 480px, so the canvas's own maxWidth:100%
|
|
386
|
+
// resolved against an already-overflowing parent. Cap the
|
|
387
|
+
// wrapper too; the flex-column children then shrink with it.
|
|
383
388
|
width: "fit-content",
|
|
389
|
+
maxWidth: "100%",
|
|
384
390
|
}),
|
|
385
391
|
[],
|
|
386
392
|
);
|
|
387
393
|
const canvasStyle: CSSProperties = useMemo(
|
|
388
394
|
() => ({
|
|
389
395
|
width,
|
|
396
|
+
// Never overflow a narrow container (phone signing surface) —
|
|
397
|
+
// the bitmap keeps its logical resolution and the pointer
|
|
398
|
+
// handlers already rescale via getBoundingClientRect, so CSS
|
|
399
|
+
// shrink is loss-free for drawing accuracy.
|
|
400
|
+
maxWidth: "100%",
|
|
390
401
|
height,
|
|
391
402
|
border: "1px solid var(--ck-border-subtle, #d4d4d8)",
|
|
392
403
|
borderRadius: "var(--ck-radius-sm, 6px)",
|
|
@@ -409,6 +420,8 @@ export const SignaturePad = forwardRef<SignaturePadHandle, SignaturePadProps>(
|
|
|
409
420
|
fontSize: 14,
|
|
410
421
|
fontFamily: "inherit",
|
|
411
422
|
width,
|
|
423
|
+
maxWidth: "100%",
|
|
424
|
+
boxSizing: "border-box",
|
|
412
425
|
}),
|
|
413
426
|
[width],
|
|
414
427
|
);
|