requesting an onCancel for useForm
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by reading the useForm entry in the Public API documentation and the Form object documentation, especially the existing cancel-button behavior. Define the expected cancellation callback semantics and update the relevant API documentation and tests once the implementation location is identified; done means callers can reliably detect form cancellation.
Written by the indexing model from the issue text.
Description
Details
There is no way of detecting when a form has been cancelled
Additional info
Discord message: _----------------------
Based on the provided knowledge sources, there doesn't appear to be a direct way to detect when a useForm has been cancelled. The documentation for useForm and related form functionalities in Devvit doesn't explicitly mention a cancellation detection mechanism.
The useForm hook, as described in the Public API documentation (https://developers.reddit.com/docs/api/public-api/#functions-1), takes two parameters: the form object and an onSubmit callback. It returns a FormKey, but there's no mention of a cancellation callback or event.
useForm<T>(form: T, onSubmit: (values: FormToFormValues<T>) => void | Promise<void>): FormKey
While forms in Devvit can have a cancel button (as mentioned in the Form object documentation (https://developers.reddit.com/docs/capabilities/forms#form-object)), there doesn't seem to be a built-in way to detect when this button is pressed or when the form is otherwise cancelled.
If you need this functionality, you might want to consider alternative approaches or request this feature through official Reddit Developer Platform channels. However, based on the current documentation, there's no direct method to detect form cancellation when using useForm.
Note: you can ask me a follow up question by @ mentioning me again 💬
----------------------_
Message author: http://kapa.ai|kapa.ai
Discord link: https://discord.com/channels/1050224141732687912/1316455772527399013/1316455820216766506
- Dominant language
- TypeScript
- Stars
- 210
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reddit/devvit
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Similar issues
-
comp/dashboard P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·