Skip to content

🔥 The free & Open Source DocuSign alternative

fix: checkbox options position

RaktimaNXG3b6591742282
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js
index fa1297c13..00a354be0 100644
--- a/apps/OpenSign/src/components/pdf/PlaceholderType.js
+++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js
@@ -343,9 +343,17 @@ function PlaceholderType(props) {
return (
<div key={ind} className="flex items-center text-center gap-0.5">
<input
+ style={{
+ width: props.pos.options?.fontSize
+ ? props.pos.options?.fontSize + "px"
+ : "12px",
+ height: props.pos.options?.fontSize
+ ? props.pos.options?.fontSize + "px"
+ : "12px"
+ }}
className={`${
ind === 0 ? "mt-0" : "mt-[5px]"
- } flex justify-center op-checkbox op-checkbox-xs rounded-[0.350rem]`}
+ } flex justify-center op-checkbox rounded-[1px] `}
onBlur={handleInputBlur}
disabled={
props.isNeedSign &&
@@ -804,9 +812,16 @@ function PlaceholderType(props) {
return (
<div key={ind} className="flex items-center text-center gap-0.5">
<input
- className={`${
- ind === 0 ? "mt-0" : "mt-[5px]"
- } ${"w-[15px] h-[15px]"} flex justify-center op-radio`}
+ style={{
+ width: props.pos.options?.fontSize
+ ? props.pos.options?.fontSize + "px"
+ : "12px",
+ height: props.pos.options?.fontSize
+ ? props.pos.options?.fontSize + "px"
+ : "12px",
+ marginTop: ind > 0 ? "10px" : "0px"
+ }}
+ className={`flex justify-center op-radio`}
type="radio"
disabled={
props.isNeedSign &&
diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js
index 702ae1ef3..1be92bc89 100644
--- a/apps/OpenSign/src/constant/Utils.js
+++ b/apps/OpenSign/src/constant/Utils.js
@@ -1379,11 +1379,11 @@ export const multiSignEmbed = async (
"email"
].includes(position.type);
if (position.type === "checkbox") {
- let checkboxOptionGapFromTop, isCheck;
+ let checkboxGapFromTop, isCheck, checkboxOptionGapTop;
let y = yPos(position);
const optionsFontSize = fontSize || 13;
- const checkboxSize = 18;
- const checkboxTextGapFromLeft = 22;
+ const checkboxSize = fontSize;
+ const checkboxTextGapFromLeft = fontSize + 5 || 22;
if (position?.options?.values.length > 0) {
position?.options?.values.forEach((item, ind) => {
const checkboxRandomId = "checkbox" + randomId();
@@ -1400,9 +1400,11 @@ export const multiSignEmbed = async (
const checkbox = form.createCheckBox(checkboxRandomId);
if (ind > 0) {
- y = y + checkboxOptionGapFromTop;
+ y = y + checkboxGapFromTop;
+ checkboxOptionGapTop = checkboxOptionGapTop + fontSize;
} else {
- checkboxOptionGapFromTop = 26;
+ checkboxGapFromTop = fontSize + 5 || 26;
+ checkboxOptionGapTop = y - 7;
}
if (!position?.options?.isHideLabel) {
@@ -1410,7 +1412,7 @@ export const multiSignEmbed = async (
const optionsPosition = compensateRotation(
page.getRotation().angle,
xPos(position) + checkboxTextGapFromLeft,
- y,
+ checkboxOptionGapTop,
1,
page.getSize(),
optionsFontSize,