Skip to content

Fix ManyToOneRelation echo loops with useControlledState#2940

Merged
markus-moser merged 2 commits into1.xfrom
fix/many-to-one-relation-controlled-state
Feb 12, 2026
Merged

Fix ManyToOneRelation echo loops with useControlledState#2940
markus-moser merged 2 commits into1.xfrom
fix/many-to-one-relation-controlled-state

Conversation

@markus-moser
Copy link
Contributor

Summary

  • Adds useControlledState hook to prevent echo loops in controlled components with debounced/async onChange handlers
  • Tracks last emitted value and ignores echoed props to prevent user input from being overwritten
  • Applied to ManyToOneRelation components

- Add useControlledState hook to prevent echo loops in controlled components
- Track last emitted value and ignore echoed props
- Prevent user input from being overwritten by debounced/async onChange handlers
- Applied to ManyToOneRelation components to fix race conditions

The hook tracks the last value emitted via onChange and compares it against incoming props to detect and ignore echoes.
@sonarqubecloud
Copy link

@markus-moser markus-moser added this to the next milestone Feb 12, 2026
@markus-moser markus-moser merged commit 7aabad1 into 1.x Feb 12, 2026
@markus-moser markus-moser deleted the fix/many-to-one-relation-controlled-state branch February 12, 2026 11:54
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant