-
Notifications
You must be signed in to change notification settings - Fork 0
Fix textarea validation tests and success state display #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
3317b88
c1c6e06
8117e6d
cd8e40c
4219a74
e770563
8452908
9fb8bac
5d3089e
3eaf6e2
79d5eac
b7ce651
56607c8
80c0d18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,8 @@ export function DebouncedInput({ | |||||||||||||
| // Define the debounced function with useCallback | ||||||||||||||
| // biome-ignore lint/correctness/useExhaustiveDependencies: from Bazza UI | ||||||||||||||
| const debouncedOnChange = useCallback( | ||||||||||||||
| debounce((newValue: string | number) => { | ||||||||||||||
| debounce((...args: unknown[]) => { | ||||||||||||||
| const newValue = args[0] as string | number; | ||||||||||||||
| onChange(newValue); | ||||||||||||||
|
Comment on lines
+25
to
27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider a more type-safe approach to maintain flexibility without losing compile-time safety. The change from a typed parameter to rest parameters with casting reduces type safety. While this makes the debounce utility more generic, the runtime cast Consider maintaining type safety while preserving flexibility: - debounce((...args: unknown[]) => {
- const newValue = args[0] as string | number;
+ debounce((newValue: string | number) => {
onChange(newValue);
}, debounceMs),If generic flexibility is required, consider using a proper generic constraint in the debounce utility instead of runtime casting. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| }, debounceMs), // Pass the wait time here | ||||||||||||||
| [debounceMs, onChange], // Dependencies | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.