Skip to content

🔥 The free & Open Source DocuSign alternative

fix: text size issue after complete signature in mobile view

RaktimaNXG732786067f97
diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
index 800ef7adf..697c42917 100644
--- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
+++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
@@ -339,9 +339,9 @@ function DropdownWidgetOption(props) {
value={
props.fontSize ||
props.currWidgetsDetails?.options?.fontSize ||
- "12"
+ 12
}
- onChange={(e) => props.setFontSize(e.target.value)}
+ onChange={(e) => props.setFontSize(parseInt(e.target.value))}
>
{fontsizeArr.map((size, ind) => {
return (
diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js
index 953eb8e14..2ea536599 100644
--- a/apps/OpenSign/src/components/pdf/Placeholder.js
+++ b/apps/OpenSign/src/components/pdf/Placeholder.js
@@ -412,7 +412,7 @@ function Placeholder(props) {
data?.format,
null,
null,
- props.fontSize || props.pos?.options?.fontSize || "12",
+ props.fontSize || props.pos?.options?.fontSize || 12,
props.fontColor || props.pos?.options?.fontColor || "black"
);
setSelectDate({ date: date, format: data?.format });
@@ -948,8 +948,8 @@ function Placeholder(props) {
<span>{t("font-size")} :</span>
<select
className="ml-[3px] md:ml:[7px] op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content text-xs"
- value={props.fontSize || clickonWidget.options?.fontSize || "12"}
- onChange={(e) => props.setFontSize(e.target.value)}
+ value={props.fontSize || clickonWidget.options?.fontSize || 12}
+ onChange={(e) => props.setFontSize(parseInt(e.target.value))}
>
{fontsizeArr.map((size, ind) => {
return (
diff --git a/apps/OpenSign/src/components/pdf/TextFontSetting.js b/apps/OpenSign/src/components/pdf/TextFontSetting.js
index 972e7a932..23ed8dc64 100644
--- a/apps/OpenSign/src/components/pdf/TextFontSetting.js
+++ b/apps/OpenSign/src/components/pdf/TextFontSetting.js
@@ -21,9 +21,11 @@ function TextFontSetting(props) {
value={
props.fontSize ||
props.currWidgetsDetails?.options?.fontSize ||
- "12"
+ 12
}
- onChange={(e) => props.setFontSize(e.target.value)}
+ onChange={(e) => {
+ props.setFontSize(parseInt(e.target.value));
+ }}
>
{fontsizeArr.map((size, ind) => {
return (
diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
index 2329f596c..bf3eb645f 100644
--- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js
+++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
@@ -276,9 +276,9 @@ const WidgetNameModal = (props) => {
<select
className="ml-[7px] op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content text-xs"
value={
- props.fontSize || props.defaultdata?.options?.fontSize || "12"
+ props.fontSize || props.defaultdata?.options?.fontSize || 12
}
- onChange={(e) => props.setFontSize(e.target.value)}
+ onChange={(e) => props.setFontSize(parseInt(e.target.value))}
>
{fontsizeArr.map((size, ind) => {
return (
diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js
index d5efe160d..06ee5a760 100644
--- a/apps/OpenSign/src/constant/Utils.js
+++ b/apps/OpenSign/src/constant/Utils.js
@@ -1304,13 +1304,9 @@ export const changeImageWH = async (base64Image) => {
};
//function to calculate font size of text area widgets
-const calculateFontSize = (position, containerScale, signyourself) => {
- const font = position?.options?.fontSize || 12;
- if (!signyourself && position?.isMobile && position?.scale) {
- return font / position?.scale / containerScale;
- } else {
- return font / containerScale;
- }
+const calculateFontSize = (position) => {
+ const fontSize = position?.options?.fontSize || 12;
+ return fontSize;
};
const getWidgetsFontColor = (type) => {
@@ -1512,11 +1508,7 @@ export const multiSignEmbed = async (
});
}
} else if (widgetTypeExist) {
- const fontSize = calculateFontSize(
- position,
- containerScale,
- signyourself
- );
+ const fontSize = calculateFontSize(position);
parseInt(fontSize);
let textContent;
if (position?.options?.response) {
diff --git a/apps/OpenSign/src/pages/DraftTemplate.js b/apps/OpenSign/src/pages/DraftTemplate.js
index 593563780..6f8863b70 100644
--- a/apps/OpenSign/src/pages/DraftTemplate.js
+++ b/apps/OpenSign/src/pages/DraftTemplate.js
@@ -1035,7 +1035,7 @@ const DraftTemplate = () => {
isReadOnly: isReadOnly || false,
isHideLabel: isHideLabel || false,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1073,7 +1073,7 @@ const DraftTemplate = () => {
defaultValue: defaultValue,
isHideLabel: isHideLabel || false,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1091,7 +1091,7 @@ const DraftTemplate = () => {
values: dropdownOptions,
defaultValue: defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1166,7 +1166,7 @@ const DraftTemplate = () => {
}
: {},
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1182,7 +1182,7 @@ const DraftTemplate = () => {
status: defaultdata.status,
defaultValue: defaultdata.defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js
index f70de6b45..c35a24c82 100644
--- a/apps/OpenSign/src/pages/PlaceHolderSign.js
+++ b/apps/OpenSign/src/pages/PlaceHolderSign.js
@@ -1339,7 +1339,7 @@ function PlaceHolderSign() {
isHideLabel: isHideLabel || false,
defaultValue: defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1377,7 +1377,7 @@ function PlaceHolderSign() {
isReadOnly: isReadOnly || false,
isHideLabel: isHideLabel || false,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1395,7 +1395,7 @@ function PlaceHolderSign() {
values: dropdownOptions,
defaultValue: defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1468,7 +1468,7 @@ function PlaceHolderSign() {
}
: {},
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1484,7 +1484,7 @@ function PlaceHolderSign() {
status: defaultdata.status,
defaultValue: defaultdata.defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js
index 9ed7d8ef3..ec4acfbdf 100644
--- a/apps/OpenSign/src/pages/SignyourselfPdf.js
+++ b/apps/OpenSign/src/pages/SignyourselfPdf.js
@@ -1028,7 +1028,6 @@ function SignYourSelf() {
const getPageNumer = xyPostion.filter(
(data) => data.pageNumber === pageNumber
);
-
if (getPageNumer.length > 0) {
const getXYdata = getPageNumer[0].pos;
const getPosData = getXYdata;
@@ -1058,7 +1057,7 @@ function SignYourSelf() {
isReadOnly: isReadOnly,
isHideLabel: isHideLabel || false,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor || currWidgetsDetails?.options?.fontColor || "black"
}
@@ -1092,7 +1091,6 @@ function SignYourSelf() {
const getPageNumer = xyPostion.filter(
(data) => data.pageNumber === pageNumber
);
-
if (getPageNumer.length > 0) {
const getXYdata = getPageNumer[0].pos;
const getPosData = getXYdata;
@@ -1102,8 +1100,7 @@ function SignYourSelf() {
...position,
options: {
...position.options,
- fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize: fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor || currWidgetsDetails?.options?.fontColor || "black"
}
diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js
index 5a0b79085..002ab26b3 100644
--- a/apps/OpenSign/src/pages/TemplatePlaceholder.js
+++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js
@@ -1123,7 +1123,7 @@ const TemplatePlaceholder = () => {
isReadOnly: isReadOnly || false,
isHideLabel: isHideLabel || false,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1161,7 +1161,7 @@ const TemplatePlaceholder = () => {
defaultValue: defaultValue,
isHideLabel: isHideLabel || false,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1179,7 +1179,7 @@ const TemplatePlaceholder = () => {
values: dropdownOptions,
defaultValue: defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1254,7 +1254,7 @@ const TemplatePlaceholder = () => {
}
: {},
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||
@@ -1270,7 +1270,7 @@ const TemplatePlaceholder = () => {
status: defaultdata.status,
defaultValue: defaultdata.defaultValue,
fontSize:
- fontSize || currWidgetsDetails?.options?.fontSize || "12",
+ fontSize || currWidgetsDetails?.options?.fontSize || 12,
fontColor:
fontColor ||
currWidgetsDetails?.options?.fontColor ||