@@ -651,6 +651,21 @@ function Placeholder(props) {
651651 }
652652 }
653653 } ;
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+ } ;
654669
655670 const getCursor = ( ) => {
656671 if ( props . data && props . isNeedSign ) {
@@ -745,12 +760,16 @@ function Placeholder(props) {
745760 ? "auto"
746761 : props . posHeight ( props . pos , props . isSignYourself )
747762 } }
763+ minHeight = { calculateFont ( props . pos . options ?. fontSize , true ) }
764+ maxHeight = "auto"
748765 onResizeStart = { ( ) => {
749766 setDraggingEnabled ( true ) ;
750767 props . setIsResize && props . setIsResize ( true ) ;
751768 } }
752769 onResizeStop = { ( e , direction , ref ) => {
753- props . setIsResize && props . setIsResize ( false ) ;
770+ setTimeout ( ( ) => {
771+ props . setIsResize && props . setIsResize ( false ) ;
772+ } , 50 ) ;
754773 props . handleSignYourselfImageResize &&
755774 props . handleSignYourselfImageResize (
756775 ref ,
@@ -785,7 +804,7 @@ function Placeholder(props) {
785804 h : ref . offsetHeight / ( props . scale * containerScale )
786805 } ) ;
787806 } }
788- onClick = { ( ) => handleOnClickPlaceholder ( ) }
807+ onClick = { ( ) => ! props . isResize && handleOnClickPlaceholder ( ) }
789808 >
790809 { props . isShowBorder &&
791810 props . pos . type !== radioButtonWidget &&
@@ -872,7 +891,7 @@ function Placeholder(props) {
872891 startDate = { startDate }
873892 handleSaveDate = { handleSaveDate }
874893 xPos = { props . xPos }
875- posHeight = { props . posHeight }
894+ calculateFont = { calculateFont }
876895 />
877896 </ div >
878897 ) : (
@@ -900,7 +919,7 @@ function Placeholder(props) {
900919 startDate = { startDate }
901920 handleSaveDate = { handleSaveDate }
902921 xPos = { props . xPos }
903- posHeight = { props . posHeight }
922+ calculateFont = { calculateFont }
904923 />
905924 </ >
906925 ) }
0 commit comments