Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Buttons cannot have display: flex in some browsers (Safari, notably) #83

Open
jfurrow opened this issue Jan 6, 2017 · 6 comments
Open
Assignees

Comments

@jfurrow
Copy link
Contributor

jfurrow commented Jan 6, 2017

http://stackoverflow.com/questions/35464067/flexbox-not-working-on-button-element-in-some-browsers

We need to remove display: flex on button elements.

@jfurrow
Copy link
Contributor Author

jfurrow commented Jan 6, 2017

When we make this change, we must also set the line-height of the buttons so that the text is centered vertically. Nevermind, we don't need to set the line-height.

@jfurrow
Copy link
Contributor Author

jfurrow commented Jan 7, 2017

Here's the fix I applied in DC/OS: dcos/dcos-ui#1750

@ashenden
Copy link
Contributor

ashenden commented Jan 9, 2017

@jfurrow I'm having a difficult time replicating this in Safari.

@jfurrow
Copy link
Contributor Author

jfurrow commented Jan 10, 2017

@ashenden Check out this pen in Safari, it illustrates the problem we encountered in DC/OS UI: http://codepen.io/yeahjohnnn/pen/XpbaWm

@ashenden
Copy link
Contributor

ashenden commented Jan 10, 2017

Ah. But with text-align:center we can solve that. The bigger one that I can't seem to solve is the dropdown arrow :after element in FF. I have a half-ass fix for this here -- #84

@jfurrow
Copy link
Contributor Author

jfurrow commented Jan 10, 2017

text-align: center works because Safari's not rendering the element with flex layout.

The dropdown's :after element in FF is a symptom of the same issue. If you change the button to an a or div it will render as expected.

I suggest we remove display: inline-flex and display: flex for button elements because it's not well supported. If we need flex containers inside buttons, we'll have to rely on a nested element.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants