Skip to content

Commit

Permalink
Merge pull request #1290 from OpenSignLabs/fix-issue
Browse files Browse the repository at this point in the history
fix: issue of optional widget fields disappear after signing process
  • Loading branch information
prafull-opensignlabs authored Oct 3, 2024
2 parents 775e325 + cf9a4d8 commit 6939150
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/OpenSign/src/constant/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,8 +1334,17 @@ export const multiSignEmbed = async (
if (signyourself) {
updateItem = item.pos;
} else {
// Checking required and optional widget types
// For both required and optional widgets, handle signurl, defaultValue, and response as the widget's data
// If the widget type is checkbox or radio (whether required or optional), we don't need to validate its value.
// Instead, add an empty checkbox/radio, or if a value exists, mark the checkbox/radio as checked.
updateItem = item.pos.filter(
(data) => data?.options?.status === "required"
(data) =>
data?.options?.SignUrl ||
data?.options?.defaultValue ||
data?.options?.response ||
data?.type === "checkbox" ||
data?.type === radioButtonWidget
);
}
} else {
Expand All @@ -1355,7 +1364,6 @@ export const multiSignEmbed = async (
}
})
);

widgetsPositionArr.forEach(async (position, id) => {
let img;
if (["signature", "stamp", "initials", "image"].includes(position.type)) {
Expand Down Expand Up @@ -1406,7 +1414,7 @@ export const multiSignEmbed = async (
};
const color = position?.options?.fontColor;
const updateColorInRgb = getWidgetsFontColor(color);
const fontSize = parseInt(position?.options?.fontSize || 13);
const fontSize = parseInt(position?.options?.fontSize || 12);
const widgetTypeExist = [
textWidget,
textInputWidget,
Expand Down

0 comments on commit 6939150

Please sign in to comment.