diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index 29ee1eca4..0ecc29a5f 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.js +++ b/apps/OpenSign/src/components/pdf/Placeholder.js @@ -542,7 +542,15 @@ function Placeholder(props) { data-tut={props.pos.key === props.unSignedWidgetId ? "IsSigned" : ""} key={props.pos.key} lockAspectRatio={ - props.pos.type !== textWidget && + // props.pos.type !== textWidget + ![ + textWidget, + "email", + "name", + "company", + "job title", + textInputWidget + ].includes(props.pos.type) && (props.pos.Width ? props.pos.Width / props.pos.Height : defaultWidthHeight(props.pos.type).width / diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index 58bdd0f14..918fdc129 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -135,7 +135,7 @@ function PlaceholderType(props) { } } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [props.pos]); + }, [props.pos?.options?.defaultValue]); const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
{ - const height = 15; + const height = 18; if (e.key === "Enter") { //function to save height of text area onChangeHeightOfTextArea( @@ -403,19 +403,12 @@ function PlaceholderType(props) { case textInputWidget: return props.isSignYourself || (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? ( - { setTextValue(e.target.value); @@ -429,6 +422,13 @@ function PlaceholderType(props) { false ); }} + className={ + isMobile + ? "labelTextArea labelWidthMobile" + : "labelTextArea labelWidthDesktop" + } + style={{ whiteSpace: "pre-wrap" }} + cols="50" /> ) : (
{ const isDefault = false; handleTextValid(e); @@ -528,6 +525,13 @@ function PlaceholderType(props) { isDefault ); }} + className={ + isMobile + ? "labelTextArea labelWidthMobile" + : "labelTextArea labelWidthDesktop" + } + style={{ whiteSpace: "pre-wrap" }} + cols="50" /> ) : (
{ handleTextValid(e); onChangeInput( @@ -562,6 +564,13 @@ function PlaceholderType(props) { false ); }} + className={ + isMobile + ? "labelTextArea labelWidthMobile" + : "labelTextArea labelWidthDesktop" + } + style={{ whiteSpace: "pre-wrap" }} + cols="50" /> ) : (
{ handleTextValid(e); onChangeInput( @@ -596,6 +603,13 @@ function PlaceholderType(props) { false ); }} + className={ + isMobile + ? "labelTextArea labelWidthMobile" + : "labelTextArea labelWidthDesktop" + } + style={{ whiteSpace: "pre-wrap" }} + cols="50" /> ) : (
{ @@ -712,6 +725,13 @@ function PlaceholderType(props) { false ); }} + className={ + isMobile + ? "labelTextArea labelWidthMobile" + : "labelTextArea labelWidthDesktop" + } + style={{ whiteSpace: "pre-wrap" }} + cols="50" /> ) : (
); diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index 044d6c0d6..d0c82b44b 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -1249,6 +1249,7 @@ export const multiSignEmbed = async ( } }; const widgetTypeExist = [ + textWidget, textInputWidget, "name", "company", @@ -1304,7 +1305,7 @@ export const multiSignEmbed = async ( checkbox.enableReadOnly(); }); } - } else if (position.type === textWidget) { + } else if (widgetTypeExist) { const font = await pdfDoc.embedFont("Helvetica"); const fontSize = 12; let textContent; @@ -1380,24 +1381,8 @@ export const multiSignEmbed = async ( color: rgb(0, 0, 0), size: fontSize }); - y -= 15; // Adjust the line height as needed - } - } else if (widgetTypeExist) { - const font = await pdfDoc.embedFont("Helvetica"); - const fontSize = 12; - let textContent; - if (position?.options?.response) { - textContent = position.options?.response; - } else if (position?.options?.defaultValue) { - textContent = position?.options?.defaultValue; + y -= 18; // Adjust the line height as needed } - page.drawText(textContent, { - x: xPos(position), - y: yPos(position) + 10, - size: fontSize, - font, - color: rgb(0, 0, 0) - }); } else if (position.type === "dropdown") { const dropdownRandomId = "dropdown" + randomId(); const dropdown = form.createDropdown(dropdownRandomId); diff --git a/apps/OpenSign/src/styles/signature.css b/apps/OpenSign/src/styles/signature.css index 4a4f23646..fa82742e7 100644 --- a/apps/OpenSign/src/styles/signature.css +++ b/apps/OpenSign/src/styles/signature.css @@ -496,11 +496,15 @@ overflow: hidden !important; text-overflow: ellipsis; } + .disabled { - opacity: 0.5; /* Example: reduce opacity to visually indicate disabled state */ - pointer-events: none; /* Prevents mouse clicks and other events */ + opacity: 0.5; + /* Example: reduce opacity to visually indicate disabled state */ + pointer-events: none; + /* Prevents mouse clicks and other events */ /* background-color: #888; */ } + .useEmail { font-size: 10px; color: #424242; @@ -851,6 +855,7 @@ option { z-index: 999; border-radius: 2px; resize: none; + overflow: hidden; } .labelTextArea:focus { diff --git a/apps/OpenSignServer/test.pdf b/apps/OpenSignServer/test.pdf index 7a2d63ada..5facc82df 100644 Binary files a/apps/OpenSignServer/test.pdf and b/apps/OpenSignServer/test.pdf differ