@@ -114,6 +114,10 @@ function Placeholder(props) {
114
114
props . pos ?. options ?. validation ?. format
115
115
)
116
116
) ;
117
+ const [ getCheckboxRenderWidth , setGetCheckboxRenderWidth ] = useState ( {
118
+ width : null ,
119
+ height : null
120
+ } ) ;
117
121
const dateFormatArr = [
118
122
"L" ,
119
123
"DD-MM-YYYY" ,
@@ -125,6 +129,21 @@ function Placeholder(props) {
125
129
"DD MMM, YYYY" ,
126
130
"DD MMMM, YYYY"
127
131
] ;
132
+
133
+ useEffect ( ( ) => {
134
+ const updateWidth = ( ) => {
135
+ const rndElement = document . getElementById ( props . pos . key ) ;
136
+ if ( rndElement ) {
137
+ const { width, height } = rndElement . getBoundingClientRect ( ) ;
138
+ setGetCheckboxRenderWidth ( { width : width , height : height } ) ;
139
+ }
140
+ } ;
141
+
142
+ // Delay to ensure rendering is complete
143
+ const timer = setTimeout ( updateWidth , 0 ) ;
144
+
145
+ return ( ) => clearTimeout ( timer ) ;
146
+ } , [ props . pos ] ) ;
128
147
//function change format array list with selected date and format
129
148
const changeDateFormat = ( ) => {
130
149
const updateDate = [ ] ;
@@ -330,8 +349,8 @@ function Placeholder(props) {
330
349
className = "fa-solid fa-gear settingIcon"
331
350
style = { {
332
351
color : "#188ae2" ,
333
- right : "9px " ,
334
- top : "-28px "
352
+ right : "29px " ,
353
+ top : "-19px "
335
354
} }
336
355
> </ i >
337
356
) : (
@@ -351,19 +370,7 @@ function Placeholder(props) {
351
370
handleOnClickSettingIcon ( ) ;
352
371
} }
353
372
className = "fa-solid fa-gear settingIcon"
354
- style = { {
355
- color : "#188ae2" ,
356
- right : [ "checkbox" , radioButtonWidget ] . includes (
357
- props . pos . type
358
- )
359
- ? "24px"
360
- : "47px" ,
361
- top : [ "checkbox" , radioButtonWidget ] . includes (
362
- props . pos . type
363
- )
364
- ? "-28px"
365
- : "-19px"
366
- } }
373
+ style = { { color : "#188ae2" , right : "47px" , top : "-19px" } }
367
374
> </ i >
368
375
)
369
376
) }
@@ -382,19 +389,7 @@ function Placeholder(props) {
382
389
props . handleLinkUser ( props . data . Id ) ;
383
390
props . setUniqueId ( props . data . Id ) ;
384
391
} }
385
- style = { {
386
- color : "#188ae2" ,
387
- right :
388
- props . pos . type === "checkbox" ||
389
- props . pos . type === radioButtonWidget
390
- ? "8px"
391
- : "32px" ,
392
- top :
393
- props . pos . type === "checkbox" ||
394
- props . pos . type === radioButtonWidget
395
- ? "-28px"
396
- : "-18px"
397
- } }
392
+ style = { { color : "#188ae2" , right : "32px" , top : "-18px" } }
398
393
> </ i >
399
394
) }
400
395
</ >
@@ -472,19 +467,7 @@ function Placeholder(props) {
472
467
className = "fa-regular fa-copy signCopy"
473
468
onClick = { ( e ) => handleCopyPlaceholder ( e ) }
474
469
onTouchEnd = { ( e ) => handleCopyPlaceholder ( e ) }
475
- style = { {
476
- color : "#188ae2" ,
477
- right :
478
- props . pos . type === "checkbox" ||
479
- props . pos . type === radioButtonWidget
480
- ? "-9px"
481
- : "12px" ,
482
- top :
483
- props . pos . type === "checkbox" ||
484
- props . pos . type === radioButtonWidget
485
- ? "-28px"
486
- : "-18px"
487
- } }
470
+ style = { { color : "#188ae2" , right : "12px" , top : "-18px" } }
488
471
> </ i >
489
472
< i
490
473
className = "fa-regular fa-circle-xmark signCloseBtn"
@@ -507,19 +490,7 @@ function Placeholder(props) {
507
490
props . setIsStamp ( false ) ;
508
491
}
509
492
} }
510
- style = { {
511
- color : "#188ae2" ,
512
- right :
513
- props . pos . type === "checkbox" ||
514
- props . pos . type === radioButtonWidget
515
- ? "-27px"
516
- : "-8px" ,
517
- top :
518
- props . pos . type === "checkbox" ||
519
- props . pos . type === radioButtonWidget
520
- ? "-28px"
521
- : "-18px"
522
- } }
493
+ style = { { color : "#188ae2" , right : "-8px" , top : "-18px" } }
523
494
> </ i >
524
495
</ >
525
496
)
@@ -528,6 +499,7 @@ function Placeholder(props) {
528
499
529
500
return (
530
501
< Rnd
502
+ id = { props . pos . key }
531
503
data-tut = { props . pos . key === props . unSignedWidgetId ? "IsSigned" : "" }
532
504
key = { props . pos . key }
533
505
lockAspectRatio = {
@@ -637,20 +609,7 @@ function Placeholder(props) {
637
609
props . pos . type !== radioButtonWidget &&
638
610
props . pos . type !== "checkbox" &&
639
611
props . pos . key === props . selectWidgetId ? (
640
- < BorderResize
641
- right = {
642
- props . pos . type === "checkbox" ||
643
- props . pos . type === radioButtonWidget
644
- ? - 21
645
- : - 12
646
- }
647
- top = {
648
- props . pos . type === "checkbox" ||
649
- props . pos . type === radioButtonWidget
650
- ? - 21
651
- : - 11
652
- }
653
- />
612
+ < BorderResize right = { - 12 } top = { - 11 } />
654
613
) : props . data && props . isNeedSign && props . pos . type !== "checkbox" ? (
655
614
props . data ?. signerObjId === props . signerObjId &&
656
615
props . pos . type !== radioButtonWidget &&
@@ -670,14 +629,15 @@ function Placeholder(props) {
670
629
setDraggingEnabled = { setDraggingEnabled }
671
630
pos = { props . pos }
672
631
isPlaceholder = { props . isPlaceholder }
632
+ getCheckboxRenderWidth = { getCheckboxRenderWidth }
673
633
/>
674
634
) }
675
635
{ isMobile ? (
676
636
< div
677
637
style = { {
678
638
left : props . xPos ( props . pos , props . isSignYourself ) ,
679
639
top : props . yPos ( props . pos , props . isSignYourself ) ,
680
- width : props . posWidth ( props . pos , props . isSignYourself ) ,
640
+ width : "auto" , // props.posWidth(props.pos, props.isSignYourself),
681
641
// height: props.posHeight(props.pos, props.isSignYourself),
682
642
zIndex : "10"
683
643
} }
0 commit comments