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

Removes unnecessary important in VerticalLayout_IE9 #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaszczw
Copy link

@jaszczw jaszczw commented Jul 18, 2017

Fixes issue for IE9 as style.display = 'table !important' was omitted when passing styles as props due to the fact it's an inline style so it takes precedence nevertheless without the need of important.

@bywo
Copy link
Owner

bywo commented Jul 18, 2017

@jaszczw thanks for this. could you explain how to repro the issue that this fixes?

I believe we still need that display: table !important. If we don't put !important there, then this style will override because it is !important: https://github.com/byronmwong/react-flexbox-layout/blob/7964ddd8e19c1c5158ff67bd3229a93f7dc01738/src/styles.css#L8

@jaszczw
Copy link
Author

jaszczw commented Jul 18, 2017

@byronmwong I see your point but

facebook/react#1881
ManuelDeLeon/viewmodel-react#19

tldr;

Styles applied via bindings do not work if they include !important

So currently !important just isn't applied at all, unless we add some specific hacks.

could you explain how to repro the issue that this fixes?

I have been trying to test library in IE9 and saw that there are no styles applied to VLayout.

@bywo
Copy link
Owner

bywo commented Jul 18, 2017

ah man, didn't know React had that limitation :(

okay, I think a better fix would be to apply another class name to the element, for example noFlexGrow. Then, add a couple more CSS rules:

.rflGrowChildStatic > .noFlexGrow { display: table !important; }

.rflGrowChildStatic .rflExpandChild > .noFlexGrow { display: table !important; }

That way, we work around the React limitation but still override display: block !important via higher specificity.

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.

2 participants