Repository navigation
Form stale values fix - #12
Merged
Merged
Conversation
- Implement comprehensive tests for RLCrudForm covering add/edit scenarios, validation, and side effects. - Create tests for RLDatePicker to ensure it displays and updates date values correctly. - Introduce tests for various input components (RLInput, RLNumberInput, RLTextArea) to validate their behavior with controlled values and user interactions. - Add helper functions for managing text fields and simulating user input. - Set up testing environment with Vitest and configure necessary settings for testing with Shoelace components.
…te package.json main entry
…improve data handling; add step prop for number inputs and implement validation tests for required fields.
…dates on change events
pzocchi
approved these changes
Oct 8, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improved test support and several enhancements to the CRUD components, focusing on more robust form handling, better user experience, and improved documentation. The most significant updates include adding Playwright and Vitest for testing, refining the form and input logic to avoid race conditions and ensure accurate validation, and updating the documentation to reflect these changes.
Testing and Documentation Improvements:
test,test:e2e) inpackage.json. Introduced aplaywright.config.tsfile to configure E2E testing, and updated the documentation inCONTRIBUTING.mdto describe running and configuring tests. [1] [2] [3] [4] [5] [6]Form and Input Handling Enhancements:
RLCrudFormto prevent unnecessary re-initializations when the form fields and values have not changed, using deep content comparison and snapshots. This avoids wiping user input when parent components re-render. [1] [2]0as a valid value and ensure arrays are considered valid only if non-empty.flushSync, preventing UI race conditions where user input could be lost if events fire before React updates the state. [1] [2] [3] [4]Dialog and Fetch Race Condition Fixes:
RLCrudto prevent race conditions when fetching data or opening dialogs by tracking the latest fetch and dialog opening, ensuring only the most recent actions are reflected in the UI. Dialogs now use unique keys based on an incrementing counter to force remounts, and timers are properly managed to avoid stale state. [1] [2] [3] [4] [5] [6] [7] [8] [9]Component API Improvements:
stepproperty toRLCrudFormFieldTypeandRLCrudInputProps, passing it through to the underlying input for more precise control over numeric and date/time fields. [1] [2] [3] [4] [5]Build and Distribution:
package.jsonfrom the UMD bundle to the standard CommonJS bundle for improved compatibility.