Skip to content

Commit

Permalink
fix: issue of optional widgets disappear after signing
Browse files Browse the repository at this point in the history
  • Loading branch information
raktima-opensignlabs committed Oct 3, 2024
1 parent 775e325 commit cf9a4d8
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 cf9a4d8

Please sign in to comment.