-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: long url not getting reset after closing modal #1502
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
Conversation
|
Someone is attempting to deploy a commit to the formbricks Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
The changes in this PR look good overall. However, I have a few suggestions to improve the code:
reset({ url: "" }); // resets only the url field
try {
const shortUrl = await createShortUrlAction(data.url.trim());
setShortUrl(shortUrl);
} catch (error) {
console.error("Failed to create short URL", error);
}
const copyShortUrlToClipboard = () => {
if (shortUrl) {
navigator.clipboard.writeText(shortUrl);
toast.success("URL copied to clipboard!");
} else {
toast.error("No URL to copy!");
}
};Please consider these suggestions and let me know if you have any questions. |
|
The changes in this PR look good overall. However, I have a few suggestions to improve the code: It seems like you're using the reset function from useForm to reset the form. This is a good practice, but it would be better to specify which fields you want to reset. This way, if you add more fields to the form in the future, you won't accidentally reset them. Here's how you can do it: |
Dhruwang
left a comment
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.
Thank you @rohan9896 for the fix, works well 😊💪
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
* main: (28 commits) chore: Add Table of Contents to README (formbricks#1427) fix: account deletion failing issue (formbricks#1509) fix: remove welcome card from email preview (formbricks#1495) fix(bug): default role implemented (formbricks#1524) fix: changing description of Code Action (formbricks#1522) refactor: Migrate activity service (formbricks#1471) fix: Error in Docs navigation formbricks#1518 (formbricks#1521) feat: dynamic title and description (formbricks#1459) fix: Spelling Errors (formbricks#1517) fix: added scrollbar whenever overflowed in the settings/profile page (formbricks#1498) fix: long url not getting reset after closing modal (formbricks#1502) fix: Unexpected Behavior when Toggling Italics in Text Editor and improve clarity of formatting status (formbricks#1506) fix: zod pin validation failing (formbricks#1507) fix: Error message on Login not shown (formbricks#1508) fix: downgrade nextjs to fix error with react email (formbricks#1516) chore: downgrade next version in formbricks-com (formbricks#1513) feat: picture selection question (formbricks#1388) feat: formtribe leaderboard update as per today (formbricks#1505) fix: Added if statement for preventing use of reserved word in question ID (formbricks#1435) fix: Disabling Welcome Card leads buggy preview (formbricks#1320) ...
What does this PR do?
Fixes # (issue)
#1501 Fixes the bug of not resetting the long URL field after closing the Modal.
https://www.loom.com/share/878810dfb8c14c04a3b820ba5b60b78e?sid=6fa377e2-33e1-40a5-9e31-5f90f47c3416
Type of change
How should this be tested?
Checklist
Required
pnpm buildconsole.logsgit pull origin mainAppreciated