react-datepicker input width will not adjust to 100%

前端 未结 8 2067
谎友^
谎友^ 2021-02-14 00:16

I am attempting to adjust the width of the react-datepicker input box and surprisingly have found little information out there and am unable to effect its width. I would just l

8条回答
  •  佛祖请我去吃肉
    2021-02-14 00:31

    This is my html

    I have used a wrapper div around the react date picker and used a specific css selector to make the wrapper divs react date picker applies around the input and the div I added to be width 100%

    this is the css selector applied to a div which wraps the above snippet

    .container > div, 
    .container > div > div.react-datepicker-wrapper, 
    .container > div > div > div.react-datepicker__input-container {
      width: 100%;
    }
    

    The result is the input box width stretches to 100% but the pop-out date picker box stays the same width

提交回复
热议问题