Skip to content
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

va-file-input-multiple: Fix multiple emits of vaMultipleChange #1440

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

ataker
Copy link
Contributor

@ataker ataker commented Dec 17, 2024

Chromatic

https://file-input-mult-event-double-emit--65a6e2ed2314f7b8f98609d8.chromatic.com

Description

Closes va-file-input-multiple emits twice on file upload #3549

A call of handleFile was added to the render function of va-file-input when read only was added. The handleFile emits vaChange which caused the second vaMultipleChange to fire in va-file-input-multiple. I added a parameter to conditionally emit change and set it to false for this call of handleFile.

Additionally this issue wasn't caught by tests because we only waited for the input change. Added waitForChanges to the page before checking how many times vaMultipleChange was emitted.

QA Checklist

  • Component maintains 1:1 parity with design mocks
  • Text is consistent with what's been provided in the mocks
  • Component behaves as expected across breakpoints
  • Accessibility expert has signed off on code changes (if applicable. If not applicable provide reason why)
  • Designer has signed off on changes (if applicable. If not applicable provide reason why)
  • Tab order and focus state work as expected
  • Changes have been tested against screen readers (if applicable. If not applicable provide reason why)
  • New components are covered by e2e tests; updates to existing components are covered by existing test suite
  • Changes have been tested in vets-website using Verdaccio (if applicable. If not applicable provide reason why)

Acceptance criteria

  • QA checklist has been completed
  • Screenshots have been attached that cover desktop and mobile screens

Definition of done

  • Documentation has been updated, if applicable
  • A link has been provided to the originating GitHub issue (or connected to it via ZenHub)

@ataker ataker added the patch Patch change in semantic versioning label Dec 17, 2024
@ataker ataker requested a review from a team as a code owner December 17, 2024 20:02
@ataker ataker merged commit fde33e2 into main Dec 18, 2024
8 checks passed
@ataker ataker deleted the file-input-mult-event-double-emit branch December 18, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Patch change in semantic versioning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

va-file-input-multiple emits twice on file upload
2 participants