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

[EuiAspectRatio] Fix incorrectly inherited height and ignored style prop #6141

Merged
merged 4 commits into from
Aug 15, 2022

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Aug 15, 2022

Summary

The video on https://elastic.github.io/eui/#/guidelines/accessibility was not working correctly due to the height: 100% set (which was attempting to inherit height from the parent div which had a flex-direction: column; set).

If we're using the aspect-ratio css (see #5818), we shouldn't be using height: 100% - we should be using height: auto due to setting width: 100%, the same way an img tag gets treated essentially.

I also noticed 2 more things while adding this fix:

  1. Any custom styles getting set by the consumer were not correctly being spread, and
  2. The div wrapper for max-width is also unnecessary if we're using the aspect-ratio CSS property: because it now behaves the same way as an img tag, the max-width can be set directly on the iframe.

Before

After

QA

Checklist

  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Added or updated jest and cypress tests
  • A changelog entry exists and is marked appropriately

- [ ] Checked in both light and dark modes
- [ ] Props have proper autodocs and playground toggles
- [ ] Added documentation
- [ ] Checked Code Sandbox works for any docs examples
- [ ] Checked for breaking changes and labeled appropriately
- [ ] Checked for accessibility including keyboard-only and screenreader modes
- [ ] Updated the Figma library counterpart

- now that we're using aspect-ratio CSS, the max-width can be set directly on the iframe along with the width/height
@cee-chen cee-chen marked this pull request as ready for review August 15, 2022 16:53
@cee-chen cee-chen requested a review from 1Copenut August 15, 2022 16:53
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_6141/

Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cee-chen cee-chen merged commit 3d78e14 into elastic:main Aug 15, 2022
@cee-chen cee-chen deleted the aspect-ratio-fix branch August 15, 2022 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants