Skip to content

Fix FileInputField to call onFilesChanged even when no file is selected (#664)#665

Merged
bedrich-schindler merged 1 commit into
masterfrom
fix/664
Oct 19, 2025
Merged

Fix FileInputField to call onFilesChanged even when no file is selected (#664)#665
bedrich-schindler merged 1 commit into
masterfrom
fix/664

Conversation

@bedrich-schindler

@bedrich-schindler bedrich-schindler commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

This is situation when user opens file selection dialog, but dismisses it by clicking on Close/Cancel button or pressing Escape key.

Before this fix, state of the input was reset, but not propagated.

Closes #664

@bedrich-schindler bedrich-schindler self-assigned this Oct 14, 2025
@bedrich-schindler bedrich-schindler added the bug Something isn't working label Oct 14, 2025
@github-actions github-actions Bot added the fix Fixing a bug label Oct 14, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes a bug where the FileInputField component's onFilesChanged callback was not being called when users dismiss the file selection dialog or when no files are selected, ensuring proper state propagation in all scenarios.

  • Added onFilesChanged callback invocation for empty file selections
  • Added onFilesChanged callback invocation when multiple files are selected but the input doesn't accept multiple files
  • Added test coverage for the scenario where no file is selected

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/FileInputField/FileInputField.jsx Added missing onFilesChanged callback calls in empty file scenarios
src/components/FileInputField/tests/FileInputField.spec.tsx Added test case to verify callback is invoked when no file is selected

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/components/FileInputField/__tests__/FileInputField.spec.tsx Outdated
…lected (#664)

This is situation when user opens file selection dialog, but dismisses
it by clicking on Close/Cancel button or pressing Escape key.

Before this fix, state of the input was reset, but not propagated.
@bedrich-schindler
bedrich-schindler merged commit 5f84fb4 into master Oct 19, 2025
11 checks passed
@bedrich-schindler
bedrich-schindler deleted the fix/664 branch October 19, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileInputField does not trigger onFilesChanged when input cancelled

3 participants