Bootstrap Datepicker appearing at incorrect location in a modal

前端 未结 7 1662
深忆病人
深忆病人 2020-12-29 20:18

I have a button on a page that calls a modal having datepicker.

If this button is at top (I don\'t have to scroll page to click), modal opens and datepicker displays

7条回答
  •  暖寄归人
    2020-12-29 21:06

    I had the same problem when using it with Bootstrap 4.1.1. The datepicker popover was appeareing on to the top of the input element.

    I fixed it using this CSS:

    /* fix bootstrap-datepicker positional bug */
    .datepicker {
      transform: translate(0, 3.1em);
    }
    

提交回复
热议问题