A touched-field map tracks interaction separately from the underlying values. A field can be touched and still contain its original value.
Worked example
type Fields = { name: string; age: number; subscribed: boolean };
const initial: Fields = { name: "Ada", age: 30, subscribed: false };
console.log([...new Set<keyof Fields>(["name", "age"])]);Result
[ 'name', 'age' ]Implementation notes
A field can be dirty without being invalid. Store validation errors, touched state and current values according to the different questions they answer.
Try it yourself
Focus and blur a valid field without typing.
Open the TypeScript example →Editorial date July 7, 2026 · Published December 6, 2026