From 7584667643dc4187b1986a55d33dc8c449420379 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Thu, 14 Mar 2024 18:35:40 +0530 Subject: [PATCH] fix: when click on label in radio or checkbox widget it's border not visible --- .../src/components/pdf/Placeholder.js | 45 +++++++++---------- .../src/components/pdf/PlaceholderType.js | 23 +++++----- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index 81a645067..d7c8f7d36 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.js +++ b/apps/OpenSign/src/components/pdf/Placeholder.js @@ -168,8 +168,8 @@ function Placeholder(props) { }; }, [isShowDateFormat]); - //onclick placeholder function to open signature pad - const handlePlaceholderClick = () => { + //`handleWidgetIdandPopup` is used to set current widget id and open relative popup + const handleWidgetIdandPopup = () => { if (props.setSelectWidgetId) { props.setSelectWidgetId(props.pos.key); } @@ -238,9 +238,18 @@ function Placeholder(props) { } } }; - - //function to set state value of onclick on widget's setting icon - const handleWidgetsOnclick = () => { + const handleOnClickPlaceholder = () => { + if (!props.isNeedSign) { + props.setWidgetType(props.pos.type); + } + if (props.isNeedSign && props.data?.signerObjId === props.signerObjId) { + handleWidgetIdandPopup(); + } else if (props.isPlaceholder || props.isSignYourself) { + handleWidgetIdandPopup(); + } + }; + //`handleOnClickSettingIcon` is used set current widget details and open setting of it + const handleOnClickSettingIcon = () => { if (props.pos.type === radioButtonWidget) { props.setIsRadio(true); } else if (props.pos.type === "dropdown") { @@ -312,11 +321,11 @@ function Placeholder(props) { { e.stopPropagation(); - handleWidgetsOnclick(); + handleOnClickSettingIcon(); }} onTouchEnd={(e) => { e.stopPropagation(); - handleWidgetsOnclick(); + handleOnClickSettingIcon(); }} className="fa-solid fa-gear settingIcon" style={{ @@ -335,11 +344,11 @@ function Placeholder(props) { { e.stopPropagation(); - handleWidgetsOnclick(); + handleOnClickSettingIcon(); }} onTouchEnd={(e) => { e.stopPropagation(); - handleWidgetsOnclick(); + handleOnClickSettingIcon(); }} className="fa-solid fa-gear settingIcon" style={{ @@ -622,14 +631,7 @@ function Placeholder(props) { false ); }} - onClick={() => { - !props.isNeedSign && props.setWidgetType(props.pos.type); - props.isNeedSign && props.data?.signerObjId === props.signerObjId - ? handlePlaceholderClick() - : props.isPlaceholder - ? handlePlaceholderClick() - : props.isSignYourself && handlePlaceholderClick(); - }} + onClick={() => handleOnClickPlaceholder()} > {props.isShowBorder && props.pos.type !== radioButtonWidget && @@ -679,14 +681,7 @@ function Placeholder(props) { // height: props.posHeight(props.pos, props.isSignYourself), zIndex: "10" }} - onTouchEnd={() => { - !props.isNeedSign && props.setWidgetType(props.pos.type); - props.isNeedSign && props.data?.signerObjId === props.signerObjId - ? handlePlaceholderClick() - : props.isPlaceholder - ? handlePlaceholderClick() - : props.isSignYourself && handlePlaceholderClick(); - }} + onTouchEnd={() => handleOnClickPlaceholder()} > {props.pos.key === props.selectWidgetId && } diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index 71614bd8b..8f5b78ce8 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -332,15 +332,14 @@ function PlaceholderType(props) {
{props.pos.options?.values?.map((data, ind) => { return ( -
+
{!props.pos.options?.isHideLabel && ( -