felixakiragreen / react-kronos

A fast, intuitive, and elegant date and time picker for React.
https://felixakiragreen.github.io/react-kronos/
MIT License
89 stars 28 forks source link

Is calendarAbove still working/is use? #76

Closed Nantris closed 4 years ago

Nantris commented 4 years ago

I know a while back the calendar automatically determined if there was space for it, but I can't seem to get the calendar to appear above the input instead of below.

I don't see it documented anywhere, or in the issues, but here's some of the styles for it: https://github.com/xenophilicibex/react-kronos/blob/master/src/styles.js#L122

felixakiragreen commented 4 years ago

It should still be working. When I resize the window on the demo site (https://xenophilicibex.github.io/react-kronos/) it changes place. Can you share a gif or screenshot/code of it not working?

Nantris commented 4 years ago

Thanks for your reply @xenophilicibex. It works fine on the demo, and I guess fails only in my particular use case. So far I'm not sure how to reproduce it, since the layout is built using flex and not doing anything that stands out as a possible cause besides using a small window. My environment is Electron@6.x

For all, now I've got to share is this dinky screenshot:

image

Note that that's a screenshot of the entire window. There's sufficient space above for the calendar, but no matter what I've tried so far, the calendar opens downwards.

felixakiragreen commented 4 years ago

I think the problem might be Electron? I'm not sure. Would adding a prop that let you manually set the calendar position address your issuue?

Nantris commented 4 years ago

Hey @xenophilicibex - thanks for your thoughts. I really thought it would, but forking the repo and setting the prop for Calendar to always resolve above as true still doesn't do it unfortunately.

Kronos works fine elsewhere in Electron, though all of our other current uses pop downward, not upward. We used to use it elsewhere to pop upward though and it worked great. Weird situation - still investigating, but if you have any other thoughts please do let me know! Thanks again!

felixakiragreen commented 4 years ago

Is the window height different?