Custom inputs guide - how to emit events from the FormKit component?
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- documentation
Research direction
Start with the custom input guide at https://formkit.com/guides/create-a-custom-input and the Architecture section on emitting events, then review discussion 943 and its suggested solution. Done means the custom input guide explains the official event-emitting approach with a working code example and links to the related discussion if useful.
Written by the indexing model from the issue text.
Description
Related discussion and solution by @SuddenDev: https://github.com/orgs/formkit/discussions/943#discussioncomment-9893014
In regards to emitting events from a custom FormKit input. I lost a lot of time today trying to figure this out, I could not find any related documentation to point me in the right direction.
All I found was a one-line note in the 'Architecture' documentation: https://formkit.com/essentials/architecture#emitting-events
Just adding a small paragraph with a code example in the custom input guide (https://formkit.com/guides/create-a-custom-input) would go a long way.
Currently I will use the solution suggested in the discussion above, which is to call the context prop as a function (feels kind of weird, but it works)
My confusion was that Props has first-class support and was very easy to add from the context object, it took me 10 minutes. But for emitting our own events from the component, there is almost nothing :(
I'd love to know if there is an 'official' Formkit way to emit events from inputs? Am I doing this all wrong?
Thank you for the great work on FormKit! If there is anything I can do to help contribute, let me know. Maybe even adding a link to the Github discussion in the documentation, would already save someone else a lot of searching.
Cheers.
- Dominant language
- JavaScript
- Stars
- 19
- Forks
- 29
- 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 formkit/docs-content
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
formkit/docs-content#151 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
formkit/docs-content#148 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
formkit/docs-content#147 ·
-
formkit/docs-content#122 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
formkit/docs-content#118 · 1 comment ·
All issues in formkit/docs-content
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Issue-Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sugarlabs/musicblocks#8924 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Opencustomer-eng status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100