-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify widget reference handling
Replace the confusing dual-prop pattern (controlRef/processControlRef) with a more idiomatic React approach using class variables. Having two parallel props for ref handling made the code hard to understand as it wasn't clear which prop was responsible for what. The old pattern of taking these callbacks via props and binding them to 'this' was also hard to debug and trace through the component hierarchy. Changes: - Use class variables to bind widget ref handlers - Consolidate ref handling into a single clear responsibility - Store widget refs directly in childRefs object - Clean up refs properly when removing items - Fix: clear validation state when list becomes empty This makes the code easier to understand and debug while laying the groundwork for future features like programmatic expansion and focusing of nested items.
- Loading branch information
Showing
5 changed files
with
86 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters