fix(FileUpload): Downgrade react-dropzone back to 9.0.0 to avoid a breaking type change, fix behavior regressions#6610
Merged
tlabaj merged 4 commits intopatternfly:mainfrom Nov 15, 2021
Conversation
…eaking type change
Collaborator
kmcfaul
approved these changes
Nov 15, 2021
Collaborator
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
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.
Closes #6609
In order to keep the changes from #6139 without any breaking TypeScript changes, this reverts react-dropzone to 9.0.0 and makes some tweaks so the new refs/events still work:
refon the hidden<input>in order to make itsonClearClickhandler work. This ref overrode the internal ref set by react-dropzone and used for the manual browse functionality. This PR sets both refs (using some tricky legacy callback ref stuff) so that both the Browse button and theonClearClickprop can work. The callback refs are not ideal, but can be reverted if we ever end up upgrading to react-dropzone 11+.getInputProps()function used here does in fact return areffunction that we need for this, even though its TypeScript type says it does not. This is a bug fixed in newer react-dropzone versions, but I work around it here with anasassertion.onTextChangeprop to that example.