File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -463,15 +463,21 @@ export class DatePicker {
463463 const left = rect . left + window . pageXOffset
464464
465465 const pickerRect = this . picker . getBoundingClientRect ( )
466+ const pickerRight = left + pickerRect . width
466467 const pickerBottom = top + pickerRect . height
467468
469+ if ( pickerRight > document . body . scrollWidth ) {
470+ this . picker . style
471+ . left = `${ document . body . scrollWidth - pickerRect . width } px`
472+ } else {
473+ this . picker . style . left = `${ left } px`
474+ }
475+
468476 if ( pickerBottom > document . body . scrollHeight ) {
469- console . log ( top , pickerRect . height , offset )
470477 this . picker . style . top = `${ top - pickerRect . height - offset } px`
471478 } else {
472479 this . picker . style . top = `${ top + rect . height + offset } px`
473480 }
474- this . picker . style . left = `${ left } px`
475481 }
476482}
477483
Original file line number Diff line number Diff line change 11{
22 "name" : " manhattan-date-picker" ,
3- "version" : " 1.0.5 " ,
3+ "version" : " 1.0.6 " ,
44 "description" : " Date parsing and picking for form fields." ,
55 "engines" : {
66 "node" : " >=8.9.4"
You can’t perform that action at this time.
0 commit comments