fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

DatePicker: Calendar without month picker is stretched to maximum width in Firefox and Chrome

Open Fensterbank opened this issue 9 years ago • 6 comments

Bug Report

  • Package version(s): current
  • Browser and OS versions: Mozilla Firefox, Google Chrome

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? No

Requested priority: Normal

Describe the issue:

When using the DatePicker if isMonthPickerVisible={false} the calendar view will use the maximum available width. This makes this control broken in these major browsers when the month picker should not be displayed. Picker works as expected in Internet Explorer 11 and Microsoft Edge.

Actual behavior:

In Mozilla Firefox and Google Chrome the calendar is stretched. Stretched Calendar

Expected behavior:

The calendar should not stretch, like it's in IE11 and Edge. Expected Calendar

Fensterbank avatar Jul 07 '17 09:07 Fensterbank

Can you put together a quick codepen to demonstrate this bug? It's certainly something we should address asap.

micahgodbolt avatar Jul 10 '17 16:07 micahgodbolt

@Fensterbank I don't see this happening on latest master bits. As Micah suggested it would be good if you could share some codepen.

aadhars avatar Jul 10 '17 19:07 aadhars

okay, I'll try to reproduce it tomorrow at work in a separated codepen. Maybe it's just an issue created by my own CSS (sorry for that, if this is true), but while the dialog disappears when I click around in the dev tools, it's not easily to debug. :)

Fensterbank avatar Jul 10 '17 19:07 Fensterbank

I found out that somewhere in my CSS there was a table { width: 100% } which affects the table in the month view.

But now it seems to be a general webcompat issue! The way this picker works, the table uses all space it needs. So if I set table width to 100%, it takes all space it can get. For me it seems Chrome and Firefox are doing it right (event if the control is broken now) and Edge and IE11 are doing it wrong.

Because codepen doesn't want to save anything, I made a jsFiddle: https://jsfiddle.net/j1fdpr30/1/

It could be adressed by a pull request which sets the table width to auto inside of a DatePicker, but I'm not sure, if we should do it. I broke the table and so I broke the control but Edge and IE don't care. ;-)

Fensterbank avatar Jul 11 '17 12:07 Fensterbank

Setting the table {width: auto} will not allow developer to set explicit width of the table and it will become difficult to control the table. In my opinion we should not make width auto and let user set the width the way he wish.

aadhars avatar Jul 15 '17 05:07 aadhars

Appears this has since been resolved, please reopen if it's still an issue

erichdev avatar Oct 12 '17 22:10 erichdev