-
Notifications
You must be signed in to change notification settings - Fork 4k
Omit componentRef from DropAreaHOC's passed props #5643
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
Omit componentRef from DropAreaHOC's passed props #5643
Conversation
|
@adroitwhiz Some things that would help move this PR forward:
|
|
b6e9618 to
5218889
Compare
5218889 to
aeb8238
Compare
|
@benjiwheeler I've added a test plan to the PR description; let me know if it's suitable! |
|
I tested this, and it seems to work well. Thanks for the excellent testing plan, @adroitwhiz! I still need to spend a little more time walking up and down the code tree to follow where |
|
Took a look at the code and traced the props down the tree in a few places. This LGTM. I tested a bunch of dragging functionality, but not everything. Could you please test all your cases, either before or after merging? (Could be easiest to test after it deploys automatically to staging, roughly half an hour after you merge it to gui develop) |
|
Thanks for taking the time to look through the codebase! I'll test backpack dragging on staging after it's merged. Is there any way to test backpack-related features locally? Logging into Scratch on the splash page from a locally-hosted scratch-www doesn't work, and navigating to the standalone |
|
@adroitwhiz |
|
I don't know if @apple502j's suggestion works -- if it does, that's cool! I've never tried to get backpack working locally, but yes, it should be possible -- if you're OK using a production backpack (that's how we handle project saving locally -- we actually save to remote projects in production, just not on the standard S3 bucket) |
Resolves
Resolves #5642
Proposed Changes
This PR omits
componentReffrom the props thatDropAreaHOCpasses into its wrapped component.Reason for Changes
If
DropAreaHOCpasses thecomponentRefprop into its wrapped component, this could potentially "clobber" alternative values ofcomponentRefif the wrapped component is not expected to have acomponentRefproperty.This happened in the
StageSelectorcomponent, which sets thecomponentRefof its childBoxcomponent and then sets all of theBox's remaining props to its own props. Because the wrappedStageSelectorgained acomponentRefprop out of nowhere, it was overwriting theBox'scomponentRef, breaking theDropAreaHOC's functionality and making it impossible to drag and drop anything onto the stage selector.Test Coverage
Not sure what the best way to test dragging is.
Browser Coverage
Check the OS/browser combinations tested (At least 2)
Linux
Mac
Windows
Chromebook
iPad
Android Tablet
Test Plan
componentRefReact prop from the props passed into the component that the DropAreaHOC wraps