ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Datetime-picker popup overlaps input field #216

Open AbhijitBRajguruKanaka opened 6 years ago

AbhijitBRajguruKanaka commented 6 years ago

Hi,

We are keeping the input field as editable so that user can enter date manually as opposed to selecting from picker. Basically keeping both options open for user to enter date. On focus of input field the datepicker pops out but if there's no sufficient space at bottom, it overlaps on input field which does not allow user to enter manually and also user can't see the field. One of the solution to solve this problem is we can show either the picker at bottom of the input field(which works fine) or on top on input field if there isn't enough space at bottom. Please refer screen shots.

In datetime-picker.directive.ts, if we change line no. 348 as below -

(thisElBcr.bottom - window.innerHeight + nguiDatetimePickerElBcr.height - 15) + 'px';

Then picker is displayed properly on top or at bottom with respect to space available.

It would be great, if we bring up this change in plugin so that it would be much user friendly. initial ss afte opening datepicker ss

allenhwkim commented 6 years ago

thanks. PR would be appreciated.