-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: openText issue #1579
fix: openText issue #1579
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Thank you for following the naming conventions for pull request titles! 🙏 |
packages/surveys/src/components/OpenTextQuestion.tsxThe code modification ensures that the input field's value is not null or undefined. This is a good practice as it prevents potential issues that could arise from assigning null or undefined to the input field's value. However, the same modification is not applied to the textarea field. It would be beneficial to apply this modification to the textarea field as well to maintain consistency and prevent potential issues. <textarea
ref={openTextRef}
rows={3}
name={question.id}
tabIndex={1}
id={question.id}
placeholder={question.placeholder}
required={question.required}
value={value ? (value as string) : ""}
type={question.inputType}
onInput={(e) => handleInputChange(e.currentTarget.value)}
autoFocus={autoFocus}
pattern={question.inputType === "phone" ? "[+][0-9 ]+" : ".*"}
title={question.inputType === "phone" ? "Please enter a valid phone number" : undefined}
className={`block w-full rounded-md border
border-slate-100
bg-slate-50 p-2 shadow-sm focus:border-slate-500 focus:outline-none focus:ring-0 sm:text-sm`}></textarea> The current implementation submits the form when the Enter key is pressed. This could lead to accidental form submissions if the user presses the Enter key unintentionally. It would be better to prevent form submission on pressing the Enter key and instead provide a clear call to action for the user to submit the form. <input
ref={openTextRef}
tabIndex={1}
name={question.id}
id={question.id}
placeholder={question.placeholder}
required={question.required}
value={value ? (value as string) : ""}
type={question.inputType}
onInput={(e) => handleInputChange(e.currentTarget.value)}
autoFocus={autoFocus}
onKeyDown={(e) => {
if (e.key == "Enter") e.preventDefault();
}}
pattern={question.inputType === "phone" ? "[+][0-9 ]+" : ".*"}
title={question.inputType === "phone" ? "Enter a valid phone number" : undefined}
className={`block w-full rounded-md border
border-slate-100
bg-slate-50 p-2 shadow-sm focus:border-slate-500 focus:outline-none focus:ring-0 sm:text-sm`}
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪🙏
* main: (42 commits) chore: add revert to oss-friends (formbricks#745) fix: pass authOptions to getServerSession in authLayout (formbricks#1584) fix: fixed URL example for "Create Survey" API endpoint is wrong formbricks#1555 (formbricks#1586) fix(docs): default account info docs changes (formbricks#1583) chore: Add docker packages to Github Packages on release (formbricks#1585) feat: avatar upload (formbricks#1546) fix: editor crashing (formbricks#1582) fix: Add scroll to the setting navbar (formbricks#1398) are you sure modal missing fix:formbricks#1419 (formbricks#1485) fix: github linting issues (formbricks#1510) refactor: added authorization to airtable integration and create a common actions file (formbricks#1538) docs: add docs for airtable (formbricks#1541) fix: missing static generation store in revalidation due to pages dir (formbricks#1581) feat: Pagination for other values in multi choice (formbricks#1560) feat: $199 pricing model for unlimited plans (formbricks#1564) fix: make pricing pages consistent (formbricks#1567) fix: openText issue (formbricks#1579) fix: avoid blocking the request if it does not have an associated ip (formbricks#1540) feat: Add Unkey to OSS Friends (formbricks#1574) feat: FOR-683 Role Switch (formbricks#1450) ...
* main: (70 commits) chore: add revert to oss-friends (formbricks#745) fix: pass authOptions to getServerSession in authLayout (formbricks#1584) fix: fixed URL example for "Create Survey" API endpoint is wrong formbricks#1555 (formbricks#1586) fix(docs): default account info docs changes (formbricks#1583) chore: Add docker packages to Github Packages on release (formbricks#1585) feat: avatar upload (formbricks#1546) fix: editor crashing (formbricks#1582) fix: Add scroll to the setting navbar (formbricks#1398) are you sure modal missing fix:formbricks#1419 (formbricks#1485) fix: github linting issues (formbricks#1510) refactor: added authorization to airtable integration and create a common actions file (formbricks#1538) docs: add docs for airtable (formbricks#1541) fix: missing static generation store in revalidation due to pages dir (formbricks#1581) feat: Pagination for other values in multi choice (formbricks#1560) feat: $199 pricing model for unlimited plans (formbricks#1564) fix: make pricing pages consistent (formbricks#1567) fix: openText issue (formbricks#1579) fix: avoid blocking the request if it does not have an associated ip (formbricks#1540) feat: Add Unkey to OSS Friends (formbricks#1574) feat: FOR-683 Role Switch (formbricks#1450) ...
What does this PR do?
Fixes a bug where input fields are filled automatically for open text questions when long answer is off
Screen.Recording.2023-11-06.at.10.27.11.AM.mov
Type of change
How should this be tested?
Create consecutive short answer open text questions
Fill one question
Check others
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated