Skip to content

Commit c3ffda4

Browse files
fix: resolving width inconsistencies with of text widgets & default data for widgets information pop-ups in mobile display.
1 parent c929b6b commit c3ffda4

File tree

5 files changed

+40
-15
lines changed

5 files changed

+40
-15
lines changed

apps/OpenSign/src/components/pdf/Placeholder.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ function Placeholder(props) {
215215
"company",
216216
"job title",
217217
"date",
218-
"email"
218+
"email",
219+
textWidget
219220
].includes(props.pos.type);
220221

221222
if (widgetTypeExist) {
@@ -594,7 +595,8 @@ function Placeholder(props) {
594595
disableDragging={
595596
props.isNeedSign
596597
? true
597-
: props.isPlaceholder && props.pos.type !== "date"
598+
: props.isPlaceholder &&
599+
!["date", textWidget].includes(props.pos.type)
598600
? false
599601
: !isDraggingEnabled
600602
}
@@ -652,8 +654,18 @@ function Placeholder(props) {
652654
style={{
653655
left: props.xPos(props.pos, props.isSignYourself),
654656
top: props.yPos(props.pos, props.isSignYourself),
655-
width: "auto", //props.posWidth(props.pos, props.isSignYourself),
657+
width:
658+
props.pos.type === radioButtonWidget ||
659+
props.pos.type === "checkbox"
660+
? "auto"
661+
: props.posWidth(props.pos, props.isSignYourself),
662+
// "auto", //props.posWidth(props.pos, props.isSignYourself),
656663
// height: props.posHeight(props.pos, props.isSignYourself),
664+
height:
665+
props.pos.type === radioButtonWidget ||
666+
props.pos.type === "checkbox"
667+
? "auto"
668+
: props.posHeight(props.pos, props.isSignYourself),
657669
zIndex: "10"
658670
}}
659671
onTouchEnd={() => handleOnClickPlaceholder()}

apps/OpenSign/src/components/pdf/PlaceholderBorder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function PlaceholderBorder(props) {
3131
};
3232
return (
3333
<div
34-
onMouseEnter={!isMobile && props?.setDraggingEnabled(true)}
34+
onMouseEnter={() => !isMobile && props?.setDraggingEnabled(true)}
3535
className="borderResize"
3636
style={{
3737
borderColor: themeColor,

apps/OpenSign/src/components/pdf/PlaceholderType.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect, useState, forwardRef, useRef } from "react";
22
import {
33
getMonth,
44
getYear,
5+
isMobile,
56
onChangeInput,
67
radioButtonWidget,
78
range,
@@ -741,6 +742,7 @@ function PlaceholderType(props) {
741742
placeholder="Enter label"
742743
rows={1}
743744
value={textValue}
745+
onBlur={handleInputBlur}
744746
onChange={(e) => {
745747
setTextValue(e.target.value);
746748
onChangeInput(
@@ -753,7 +755,11 @@ function PlaceholderType(props) {
753755
false
754756
);
755757
}}
756-
className="labelTextArea"
758+
className={
759+
isMobile
760+
? "labelTextArea labelWidthMobile"
761+
: "labelTextArea labelWidthDesktop"
762+
}
757763
style={{ whiteSpace: "pre-wrap" }}
758764
cols="50"
759765
/>

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ function PlaceHolderSign() {
317317

318318
//function for setting position after drop signature button over pdf
319319
const addPositionOfSignature = (item, monitor) => {
320-
if (item && item.text) {
321-
setWidgetName(item.text);
322-
}
323320
getSignerPos(item, monitor);
324321
};
325322

@@ -336,7 +333,7 @@ function PlaceHolderSign() {
336333
let dropData = [];
337334
let placeHolder;
338335
const dragTypeValue = item?.text ? item.text : monitor.type;
339-
336+
console.log("option", dragTypeValue);
340337
if (item === "onclick") {
341338
const dropObj = {
342339
//onclick put placeholder center on pdf
@@ -487,10 +484,11 @@ function PlaceHolderSign() {
487484
setIsCheckbox(true);
488485
} else if (dragTypeValue === radioButtonWidget) {
489486
setIsRadio(true);
490-
}
487+
}
491488
setWidgetType(dragTypeValue);
492489
setSignKey(key);
493490
setCurrWidgetsDetails({});
491+
setWidgetName(dragTypeValue);
494492
}
495493
}
496494
};
@@ -1755,7 +1753,6 @@ function PlaceHolderSign() {
17551753
</button>
17561754
</div>
17571755
</ModalUi>
1758-
17591756
<LinkUserModal
17601757
handleAddUser={handleAddUser}
17611758
isAddUser={isAddUser}

apps/OpenSign/src/styles/signature.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,18 @@ option {
837837
justify-content: flex-start;
838838
}
839839

840-
.labelTextArea {
841-
font-size: 12px;
840+
.labelWidthDesktop {
842841
min-width: 100%;
843842
min-height: 100%;
843+
}
844+
845+
.labelWidthMobile {
846+
width: 100%;
847+
height: 100%;
848+
}
849+
850+
.labelTextArea {
851+
font-size: 12px;
844852
border: 1px solid #007bff;
845853
outline: none;
846854
z-index: 999;
@@ -944,7 +952,7 @@ option {
944952
to prevent sudden quick movement (as the
945953
navigation bar gets a new position at the top of the
946954
page (position:fixed and top:0) */
947-
.stickyHead + .content {
955+
.stickyHead+.content {
948956
padding-top: 60px;
949957
}
950958

@@ -1173,6 +1181,7 @@ option {
11731181
font-size: 12px;
11741182
margin-left: 5px;
11751183
}
1184+
11761185
.defaultOptions:focus {
11771186
outline: none;
11781187
}
@@ -1191,6 +1200,7 @@ option {
11911200
min-width: 90%;
11921201
overflow-y: auto;
11931202
}
1203+
11941204
.signatureBtn {
11951205
width: max-content;
11961206
}
@@ -1224,4 +1234,4 @@ option {
12241234
min-width: 78%;
12251235
overflow-y: auto;
12261236
}
1227-
}
1237+
}

0 commit comments

Comments
 (0)