fix: ranking ques performance (#4301)

This commit is contained in:
Piyush Gupta
2024-12-02 10:09:58 +05:30
committed by GitHub
parent a1c7c4a310
commit 69625ae832
3 changed files with 43 additions and 26 deletions

View File

@@ -75,6 +75,10 @@ export const RankingQuestionForm = ({
const addOption = () => {
const choices = !question.choices ? [] : question.choices;
if (choices.length >= 25) {
return;
}
const newChoice = {
id: createId(),
label: createI18nString("", surveyLanguageCodes),
@@ -224,6 +228,7 @@ export const RankingQuestionForm = ({
variant="secondary"
EndIcon={PlusIcon}
type="button"
disabled={question.choices?.length >= 25}
onClick={() => addOption()}>
{t("environments.surveys.edit.add_option")}
</Button>