-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DropZone - File upload positioning issue #1127
Conversation
I see Percy spotted an issue with the "Nested Drop Zone" example. |
Another option discussed on slack would be to add a prop to <DropZone.FileUpload centered={false} /> set to |
ef93541
to
44f73f8
Compare
At a glance feels odd to me to have non-structure components have props that affect positioning. Curious what everyone else thinks about this? |
An option would be to leave it as is, and have the consumer override the display: flex with their own container if they need to. |
44f73f8
to
24719dc
Compare
24719dc
to
b5125d4
Compare
I've pushed a fix that adds a I don't have much more time to focus on this, so if @elizabethletourneau with the support of @AndrewMusgrave could finish this off, that would be appreciated.
<React.Fragment>
<div style={{width: 50}}>
<DropZone>
<DropZone.FileUpload />
</DropZone>
</div>
<div style={{width: 114}}>
<DropZone>
<DropZone.FileUpload />
</DropZone>
</div>
<div style={{width: 50}}>
<DropZone centerAlignChildren={false}>
<DropZone.FileUpload />
</DropZone>
</div>
<div style={{width: 114}}>
<DropZone centerAlignChildren={false}>
<DropZone.FileUpload />
</DropZone>
</div>
<div style={{width: 500}}>
<DropZone centerAlignChildren={false}>
<DropZone.FileUpload />
</DropZone>
</div>
<div style={{width: 500, height: 500}}>
<DropZone centerAlignChildren={false}>
<DropZone.FileUpload />
</DropZone>
</div>
</React.Fragment> |
b5125d4
to
1ae0994
Compare
1ae0994
to
5d37050
Compare
Closing in favor of #1129 |
WHY are these changes introduced?
In 3.9 this PR added the ability to specify a height to the drop zone.
When a height container does have a height, we added
display: flex
to ensure that theDropZone.FileUpload
was vertically and horizontally aligned. This however causes issue because we really have no control what the children of that container will be (In web this breaks the ProductShow implementation)WHAT is this pull request doing?
From the DropZone component we also don't know what the children are. It could be 'DropZone.FileUpload` or not. So the best solution I could come up with, is the add a Flex layout to the FileUpload if it's the only child. I really don't like the fact the FileUpload is responsible for it's positioning, but it's the safest approach I could think of.
**This PR is not ready to deploy. It's here for discussion. Also note I branched right from 3.9 in case we end up doing a patch release for this **
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist