Browse Source

fix(ui): make 4-option radio questions render vertically with radio indicators

master
mortezaei 1 day ago
parent
commit
d66506b39a
  1. 5
      src/components/Componentes/question-checkbox.tsx
  2. 6
      src/components/Componentes/question-radio.tsx

5
src/components/Componentes/question-checkbox.tsx

@ -113,9 +113,10 @@ export function QuestionCheckbox({
);
};
// Render horizontally only for 2-option binary choices
const isShortOptions =
options.length <= 4 &&
options.every((opt) => String(opt.label || opt.value || "").length <= 15);
options.length <= 2 &&
options.every((opt) => String(opt.label || opt.value || "").length <= 10);
return (
<div

6
src/components/Componentes/question-radio.tsx

@ -22,10 +22,10 @@ export function QuestionRadio({
return null;
}
// Render horizontally if all options are short (e.g. Single, Divorced, Widowed)
// Render horizontally only for 2-option binary choices (e.g. Yes/No, Male/Female)
const isShortOptions =
options.length <= 4 &&
options.every((opt) => String(opt.label || opt.value || "").length <= 15);
options.length <= 2 &&
options.every((opt) => String(opt.label || opt.value || "").length <= 10);
return (
<div

Loading…
Cancel
Save