@@ -651,6 +651,21 @@ function Placeholder(props) {
651
651
}
652
652
}
653
653
} ;
654
+ //function to calculate font size
655
+ const calculateFont = ( size , isMinHeight ) => {
656
+ const containerScale = getContainerScale (
657
+ props . pdfOriginalWH ,
658
+ props . pageNumber ,
659
+ props . containerWH
660
+ ) ;
661
+ const fontSize = ( size || 12 ) * containerScale * props . scale ;
662
+ //isMinHeight to set text box minimum height
663
+ if ( isMinHeight ) {
664
+ return fontSize * 1.5 + "px" ;
665
+ } else {
666
+ return fontSize + "px" ;
667
+ }
668
+ } ;
654
669
655
670
const getCursor = ( ) => {
656
671
if ( props . data && props . isNeedSign ) {
@@ -745,12 +760,16 @@ function Placeholder(props) {
745
760
? "auto"
746
761
: props . posHeight ( props . pos , props . isSignYourself )
747
762
} }
763
+ minHeight = { calculateFont ( props . pos . options ?. fontSize , true ) }
764
+ maxHeight = "auto"
748
765
onResizeStart = { ( ) => {
749
766
setDraggingEnabled ( true ) ;
750
767
props . setIsResize && props . setIsResize ( true ) ;
751
768
} }
752
769
onResizeStop = { ( e , direction , ref ) => {
753
- props . setIsResize && props . setIsResize ( false ) ;
770
+ setTimeout ( ( ) => {
771
+ props . setIsResize && props . setIsResize ( false ) ;
772
+ } , 50 ) ;
754
773
props . handleSignYourselfImageResize &&
755
774
props . handleSignYourselfImageResize (
756
775
ref ,
@@ -785,7 +804,7 @@ function Placeholder(props) {
785
804
h : ref . offsetHeight / ( props . scale * containerScale )
786
805
} ) ;
787
806
} }
788
- onClick = { ( ) => handleOnClickPlaceholder ( ) }
807
+ onClick = { ( ) => ! props . isResize && handleOnClickPlaceholder ( ) }
789
808
>
790
809
{ props . isShowBorder &&
791
810
props . pos . type !== radioButtonWidget &&
@@ -872,7 +891,7 @@ function Placeholder(props) {
872
891
startDate = { startDate }
873
892
handleSaveDate = { handleSaveDate }
874
893
xPos = { props . xPos }
875
- posHeight = { props . posHeight }
894
+ calculateFont = { calculateFont }
876
895
/>
877
896
</ div >
878
897
) : (
@@ -900,7 +919,7 @@ function Placeholder(props) {
900
919
startDate = { startDate }
901
920
handleSaveDate = { handleSaveDate }
902
921
xPos = { props . xPos }
903
- posHeight = { props . posHeight }
922
+ calculateFont = { calculateFont }
904
923
/>
905
924
</ >
906
925
) }
0 commit comments