Skip to content

Conversation

bedrich-schindler
Copy link
Contributor

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

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
Copy link

@Copilot Copilot AI left a comment

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.

…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.
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

2 participants