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

IE11: Column inside a row may overflow its parent #29

Open
FrancescoCioria opened this issue Jun 7, 2017 · 1 comment
Open

IE11: Column inside a row may overflow its parent #29

FrancescoCioria opened this issue Jun 7, 2017 · 1 comment
Assignees
Labels

Comments

@FrancescoCioria
Copy link
Contributor

description

On IE11 if the content of a column rendered inside a row has a base width bigger than the row itself, the column will overflow its parent even if it shouldn't

how to reproduce

<FlexView width={100}>
  <FlexView column>
    asduhaudhausda asdoihaid dasidaishd alodhiashd alidhiasdh alisdhiashd aoidshaisdh oasdihasidh aidhasidh oaidhaisdh aoidhaisdh asdhaosidh
  </FlexView>
</FlexView>

On chrome the text column is 100px wide, on IE11 it's as wide as its content...

FlexView should somehow prevent this bug or, if not possible, warn the user when in dev that they might face it.

specs

Apparently not only IE11 fails at forcing the column to not exceed its parent but it also ignores an explicit max-width if set to 100%....

I found this possible fix: add style={{ maxWidth: 99.99 }} to the column (any value apart from 100% is correctly understood by IE11)

We could:

  1. add that fix to any FlexView column -> very breaking, implicit and opinionated
  2. only in dev: if I'm a column + my parent is a flexview row + I don't have an explicit basis/width/max-width -> log a warning that link to a section in the readme that explain the issue and how to manually fix it

misc

{optional: other useful info}

@FrancescoCioria FrancescoCioria self-assigned this Jun 7, 2017
@FrancescoCioria
Copy link
Contributor Author

or we use bowser:

detectBrowser() {
  return window && bowser._detect(window.navigator.userAgent);
}

getStyle() {
  const isIE = this.detectBrowser() === 'msie';
  const style = pick(this.props, [
    'width',
    'height',
    'marginLeft',
    'marginTop',
    'marginRight',
    'marginBottom'
  ]);
  return {
    ...this.getFlexStyle(),
    ...style,
    maxWidth: (this.props.column && isIE) ? '99.99%' : undefined,
    ...this.props.style
  };
}

@FrancescoCioria FrancescoCioria changed the title IE11: Column inside a row may overflow their parent IE11: Column inside a row may overflow its parent Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant