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

[v2] Ant Design components don't work correctly (body > div sets height 100%) #2364

Closed
jugglingcats opened this issue Mar 6, 2020 · 0 comments · Fixed by #2367
Closed

[v2] Ant Design components don't work correctly (body > div sets height 100%) #2364

jugglingcats opened this issue Mar 6, 2020 · 0 comments · Fixed by #2367
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@jugglingcats
Copy link

jugglingcats commented Mar 6, 2020

🐛 Bug Report

The components we are trying to document use Ant Design (https://ant.design). The docusaurus stylesheet contains the following:

body > div {
  height: 100%;
  display: flex;
  flex-direction: column;
}

This causes a problem with Ant Design (and potentially other libs) as their code creates a div under body for some components, and expect these to not be 100% height. The additional height causes issue for mouse events and effectively locks up most of the page.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

Note that the example project below is using Lerna. This is just to make the repro easier -- our actual project doesn't use Lerna but exhibits the same behaviour.

  1. Download / clone https://github.com/jugglingcats/docusaurus-repro
  2. lerna bootstrap
  3. cd docusaurus-site
  4. npm start
  5. Navigate to Ant Design Example page
  6. Click on select dropdown to open and close it again
  7. Try to open it again

Expected behavior

Page should continue to work.

Actual Behavior

Page is unresponsive. This is due to height 100% on the div that antd adds to end of body:

image

A workaround is to force body > div to be auto size in custom.css:

body > div {
  height: auto !important;
}

image

It looks to me that there is only one div in the default docusaurus page and it has an id, so maybe a more specific css rule would be more appropriate in the default stylesheet.

Your Environment

  • Docusaurus version used: 2.0.0-alpha.43
  • Ant Design 4.0.1
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
  • Operating system and version (desktop or mobile):

Reproducible Demo

https://github.com/jugglingcats/docusaurus-repro

See above for detailed steps.

@jugglingcats jugglingcats added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 6, 2020
@jugglingcats jugglingcats changed the title [v2] Ant Design components don't work in pages (body > div sets height 100%) [v2] Ant Design components don't work correctly (body > div sets height 100%) Mar 6, 2020
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Mar 6, 2020
@lex111 lex111 removed the status: needs triage This issue has not been triaged by maintainers label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants