ericjgagnon / wickedpicker

A simple jQuery timepicker
http://ericjgagnon.github.io/wickedpicker/
MIT License
93 stars 78 forks source link

Popup Box Positions At Bottom Of Page #5

Closed jkardong closed 8 years ago

jkardong commented 8 years ago

Description

When opening the WickedPicker, the popup box opens at the bottom of the page, not below the text box it's attached to

Expected Result

Opens directly to the side of text box

Actual Result

Popup Box appears off page if page is long.

Possible Cause

Could this be caused by competing CSS? If I want to adjust the position of the box, where should I do this?

ericjgagnon commented 8 years ago

I haven't used this on a really long page so I can't really visualize or experience what is happening with you project. I think it could be competing CSS, specifically I think you should take a look at this line https://github.com/ericjgagnon/wickedpicker/blob/master/src/wickedpicker.js#L107. I'm setting the picker's position to be relative, its z-index to 1 greater than the input's, and then setting its top and left positions.

Cha0s2nd commented 8 years ago

On line https://github.com/ericjgagnon/wickedpicker/blob/master/src/wickedpicker.js#L111 the element.offsetHeight is undefined causing the top never to be set and for some reason element[0].offsetHeight works.

jkardong commented 8 years ago

Good catch. Added the element[0] and it started working on my project.

ericjgagnon commented 8 years ago

I cannot believe I make this mistake face palm