[Feature Request] Expose the "isDirty" flag on a form and inputs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 41k
- Forks
- 7.1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 11
Description
Problem to solve
There is isValid value exposed on a form but no isDirty value.
Moreover, it's impossible to get an input's isDirty value through formRef.items or inputRef. The values are only available to slots (at least that is what documentation says).
So, it looks like there is no way to know if a form (or even an input) is dirty to prevent a user from leaving without saving the form data.
Proposed solution
It would be greate to be able to get isDirty values through the form or\and input refs.
Contributor guide
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.
Research direction
Start by tracing the form and input ref APIs mentioned in the issue, especially formRef.items and inputRef, and compare them with the slot-provided values described in the documentation. Determine where isValid is exposed and what corresponding isDirty behavior should cover for forms and inputs; done means the values are accessible through the requested refs and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100