react-datepicker input width will not adjust to 100%

前端 未结 8 2020
谎友^
谎友^ 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:26

    To prevent the flex items from shrinking, set the flex shrink factor to 0:

    .myContainer .myItem { flex-shrink: 0; }

    .myContainer {
      display: flex;
      flex-wrap: nowrap;
      flex-direction: row;
      flex: 1 1 0px;
    }
    
    .myDatePicker {   
      width: 100%; 
    }

    The above snippet just works so there MUST be other code interfering with css or scaffolding.

提交回复
热议问题