react-component / picker

📅 All Date Pickers you need.

Home Page:https://picker.react-component.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rangepicker不支持受控

ooooevan opened this issue · comments

commented

rangepicker我想使用受控模式,发现选择完后,下拉框不能自动收起

export default () => {
  const [open, setOpen] = useState(false);

  return (
    <div>
      <RangePicker<Moment>
        generateConfig={momentGenerateConfig}
        locale={zhCN}
        picker="week"
        allowClear
        open={open}
        onOpenChange={(open) => {
          console.log("onOpenChange =>", open);
          setOpen(open);
        }}
      />
      <button type="button">233</button>
    </div>
  );
};

codesandbox