react-component / react-component/picker

rangepicker不支持受控

Open
#698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
304
Forks
345
Avg merge
2d 7h
Merged PRs (30d)
7

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the linked CodeSandbox and reproduce the controlled RangePicker case using open and onOpenChange with the week picker. Trace the RangePicker behavior for controlled visibility, then verify that selecting a range closes the dropdown while the controlled state remains synchronized.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.