uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.66k stars 6.08k forks source link

Bootstrap datepicker in arabic showing extended width #2299

Open hassan715 opened 6 years ago

hassan715 commented 6 years ago

Expected behaviour

Width shouldn't exceed the screen width.

Actual behaviour

When opened the width exceeds the screen width especially when using a mobile browser. This behavior appears when using RTL template.

screenshot_2017-11-10-17-15-15

Datepicker version used

v1.7.1

ilyaqq1999 commented 2 years ago

Fixed it like tihs: var elementWidth = this.component ? this.component.parent().width() : this.element.width(); if (this.o.rtl) { var right = windowWidth - (left + elementWidth); this.picker.css({ top: top, right: right, zIndex: zIndex }); } else { this.picker.css({ top: top, left: left, zIndex: zIndex }); }