time-picker icon indicating copy to clipboard operation
time-picker copied to clipboard

Make timepicker's popup similar to "Tethered component" (like react-datepicker) which positions according to scroll

Open nrvikas opened this issue 7 years ago • 4 comments

When timepicker's popup is open inside a div container and if that external container is scrolled, the timpicker's popup does not position itself according to the scroll. Can it be made similar to https://github.com/Hacker0x01/react-datepicker ? The pop-up which is opened is tethered component which positions itself when outer container is scrolled ?

Or, if I'm missing something and this is already possible, please guide accordingly. So far, I'm only allowed to pick the placement, but the position remains "static" when containing container is scrolled.

nrvikas avatar Apr 03 '17 06:04 nrvikas

Check out react-popper to add this kind of behavior

FezVrasta avatar Apr 06 '17 12:04 FezVrasta

+1

It would be incredibly useful if we could specify where in the DOM the time picker gets placed, as this would allow us to work around the scrolling issues described by @nrvikas. For example:

<TimePicker location=".some-selector" />

or

<TimePicker location={ someDomElem } />

... or at the very least, provide an option to have it render in place, e.g.:

<body>
    <div>
        <TimePicker renderInPlace />
    <div>
</body>

which would output:

<body>
    <div>
        <!-- Time Picker HTML -->
    <div>
</body>

... instead of rendering the HTML right before the closing </body> tag, like it currently does:

<body>
    <div><div>
     <!-- Time Picker HTML -->
</body>

callmeaponte avatar Jul 19 '17 23:07 callmeaponte

I wrote a horrible hack to reposition the element with a function on the onOpen property that uses a window.setTimeout to move the DOM node. May the [insert your deity] forgive me.

mikeyc7m avatar Sep 06 '17 02:09 mikeyc7m

looks like this was solved in #89

peterkuykendall avatar May 26 '18 08:05 peterkuykendall