mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-20 17:31:27 -05:00
Added optional enter to submit event
This commit is contained in:
@@ -77,7 +77,9 @@ export default function MultipleChoiceSingleQuestion({
|
||||
onKeyDown={(e) => {
|
||||
if (e.key == "Enter") {
|
||||
onChange({ [question.id]: choice.label });
|
||||
onSubmit({ [question.id]: choice.label });
|
||||
setTimeout(() => {
|
||||
onSubmit({ [question.id]: choice.label });
|
||||
}, 350);
|
||||
}
|
||||
}}
|
||||
className={cn(
|
||||
@@ -150,6 +152,11 @@ export default function MultipleChoiceSingleQuestion({
|
||||
onChange={(e) => {
|
||||
onChange({ [question.id]: e.currentTarget.value });
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key == "Enter") {
|
||||
onSubmit({ [question.id]: value });
|
||||
}
|
||||
}}
|
||||
placeholder="Please specify"
|
||||
className="mt-3 flex h-10 w-full rounded-md border border-slate-300 bg-transparent bg-white px-3 py-2 text-sm text-slate-800 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-500 dark:text-slate-300"
|
||||
required={question.required}
|
||||
|
||||
Reference in New Issue
Block a user