Open lucafaggianelli opened 9 months ago
@severinlandolt hey, I feel I can fix this. Should I submit a PR?
That would be great! I just assigned you. I have to go to sleep now🤣
That would be great! I just assigned you. I have to go to sleep now🤣
Would try to submit the PR by the time you wake up!🤣
Hey guys, I was experimenting with the component and sort of found it difficult to fix the alignment automatically. This is so because the Calendar is being rendered in an absolute component, which makes it very tricky to use flex boxes. I however, created a flag that will dock the calendar to left/right, thereby fixing the issue.
Here is a demo
Can anyone suggest any improvements? @severinlandolt @lucafaggianelli
I've completed some tests and its basically a feature that our underlying library (headlessui) does not offer natively.
Thank you @rajdip-b for your initial effort and suggesting a new prop. We will do some thinking around that an come back later!
I've completed some tests and its basically a feature that our underlying library (headlessui) does not offer natively.
Thank you @rajdip-b for your initial effort and suggesting a new prop. We will do some thinking around that an come back later!
Sure!!
Yep indeed I reached the same conclusion on headlessui. Though I saw you use the lib floating ui as well in tremor, which seems more suited for this task.
About the new property, maybe I would call it "anchor" or something similar to make it more flexible so it could have values like right, left, center for the horizontal alignment and top, bottom, middle for the vertical one, I see many libs using this pattern.
Yep indeed I reached the same conclusion on headlessui. Though I saw you use the lib floating ui as well in tremor, which seems more suited for this task.
About the new property, maybe I would call it "anchor" or something similar to make it more flexible so it could have values like right, left, center for the horizontal alignment and top, bottom, middle for the vertical one, I see many libs using this pattern.
Yeah even I did notice that. Should I proceed with the implementation, see what all changes I can implement? @lucafaggianelli @severinlandolt
Good news: https://x.com/adamwathan/status/1729274129264624056?s=20
I guess this issue can be closed then?
I will keep it open until Headless UI has been updated
Sure!
Any update on this?
Hi @rlancejohnson → still blocked! Waiting for headless ui 4.0.
Hi @lucafaggianelli @rajdip-b @rlancejohnson! Brief update: The overflow problem still persists and it looks like that this won't be fixable soon. I will update this asap once there is a fixing headless ui release.
If you are in desperate need of a date picker with improved positioning, it's worth taking a look here: https://raw.tremor.so/docs/inputs/date-range-picker
Tremor Version
3.11.1
Link to minimal reproduction
none
Steps to reproduce
What is expected?
the floating menu containing the calendar should be automatically moved to fit into the page
I would also accept an
anchor
option to force the menu to be anchored on the right of the input field rather than on the leftWhat is actually happening?
What browsers are you seeing the problem on?
Chrome
Any additional comments?
No response