React-calendar: Broken layout in Safari mobile

Created on 13 Mar 2018  路  9Comments  路  Source: wojtekmaj/react-calendar

On a desktop browser this calendar appears just fine, but when I view this on my iPhone 7 in my Safari app, the last weekday's dates get pushed to the next line like this:

image

bug

Most helpful comment

@wojtekmaj Adding margin:0 to .react-calendar_tile fixes the issue for me in safari (iOS and desktop)

All 9 comments

Hey Lisa,
I need a little more information to help you. Is the same issue happening when you open the following pages?

  1. Demo page
  2. Test page

Hi,
in IE11 there is a similar issue:
unbenannt

On the demo page, it looks like this:
image

On the test page, it looks like this:
image

Thank you for your help!

@lisahoong, it looks like tile elements have some additional margin or a border, which is not standard button styling. I sadly have no Safari. Would you please try using this CSS and tell me if it works for you? If it does, I'll push the fix.

.react-calendar__tile {
  margin: 0;
  border: 0;
}

@PiTomar, thanks for mentioning it - I could reproduce this, indeed IE fails to scale flex items properly.

@wojtekmaj Is that fix for IE in already? Just trying to figure out if the issue is on my end now haha

@nathan-haines, it has landed on master branch; now I just need info from Lisa if the other part of the fix had worked :) I'd rather push an entire fix.

For those interested - Internet Explorer seems to be ignoring box-sizing: border-box property when in flex boxes. Tiles are measured to have exactly 100% / 7 width, but Internet Explorer measures them and THEN applies the padding which makes the tiles larger. max-width: 100% / 7 does the trick.

@wojtekmaj Adding margin:0 to .react-calendar_tile fixes the issue for me in safari (iOS and desktop)

Thank you so much!!

My pleasure :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andymj picture andymj  路  5Comments

wojtekmaj picture wojtekmaj  路  3Comments

dumkanki picture dumkanki  路  3Comments

tranvula picture tranvula  路  4Comments

amansur picture amansur  路  6Comments