fix: radio button options and selecting issue

This commit is contained in:
RaktimaNXG
2024-02-07 17:36:07 +05:30
parent 83fa9c9ebd
commit ef68fe1c85
3 changed files with 24 additions and 12 deletions
@@ -206,7 +206,7 @@ function Placeholder(props) {
props.setWidgetType(props.pos.type);
props.setCurrWidgetsDetails(props.pos);
}}
class="fa-solid fa-gear settingIcon"
className="fa-solid fa-gear settingIcon"
style={{
color: "#188ae2",
right:
@@ -277,7 +277,7 @@ function Placeholder(props) {
}}
>
<i
class="fa-solid fa-gear settingIcon"
className="fa-solid fa-gear settingIcon"
style={{
color: "#188ae2",
fontSize: "14px"
@@ -423,7 +423,7 @@ function Placeholder(props) {
props.pos.type !== "radio"
? true
: false
: true,
: props.pos.type !== "radio" && true,
bottomLeft: false,
topLeft: false
}}
@@ -499,7 +499,7 @@ function Placeholder(props) {
: props.isSignYourself && handlePlaceholderClick();
}}
>
{props.isShowBorder ? (
{props.isShowBorder && props.pos.type !== "radio" ? (
<BorderResize
right={
(props.pos.type === "checkbox" || props.pos.type === "radio") &&
@@ -522,7 +522,7 @@ function Placeholder(props) {
<></>
)
) : (
<BorderResize />
props.pos.type !== "radio" && <BorderResize />
)}
{props.isShowBorder && (
@@ -553,7 +553,8 @@ function PlaceholderType(props) {
// height: props.pos.Height,
display: "flex",
justifyContent: "center",
marginBottom: "3px"
marginBottom: "6px",
marginTop: "5px"
}}
type="radio"
checked={isCheckedRadio.selectValue === data}
@@ -370,7 +370,7 @@ export const defaultWidthHeight = (type) => {
case "radio":
obj = {
width: 15,
height: 15
height: 20
};
return obj;
default:
@@ -1058,16 +1058,27 @@ export const multiSignEmbed = async (
dropdown.enableReadOnly();
} else if (imgData.type === "radio") {
const rocketField = form.createRadioGroup(randomboxId);
let addYPosition = 20;
imgData.widgetOption.map((data, ind) => {
let addYPosition = 18;
for (let i = 1; i <= imgData?.widgetOption.length; i++) {
const data = imgData?.widgetOption[i - 1];
let yPosition;
if (i > 1) {
yPosition = yPos(imgData) + addYPosition;
} else {
yPosition = yPos(imgData);
}
rocketField.addOptionToPage(data, page, {
x: xPos(imgData),
y: ind === 0 ? yPos(imgData) : yPos(imgData) - addYPosition,
y: yPosition,
width: 11,
height: 11
});
addYPosition = ind !== 0 && addYPosition + 20;
});
if (i > 1) {
addYPosition = addYPosition + 18;
}
}
rocketField.select(imgData.widgetValue);
rocketField.enableReadOnly();