react-component / react-component/cascader

能否增加props属性以控制scroll

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
233
Forks
149
Avg merge
10h 23m
Merged PRs (30d)
2

Description

如下代码,当展开下拉菜单时将导致自动滚动到顶部,原因是调用scrollIntoParentView时,下拉菜单尚未完成渲染,导致自动滚动到顶部。希望在props中增加对scroll的控制。

const Cascader: FC<CascaderProps> = (props) => {
  const rolePropOptions = useModel('dubbing', ({ rolePropOptions }) => rolePropOptions);

  return <AntdCascader options={rolePropOptions} {...props} />;
};

export default Cascader;

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

Start by locating the CascaderProps definition and the scrollIntoParentView call in the repository. Reproduce the dropdown-opening behavior using the TypeScript example and inspect how rendering timing triggers the scroll. Done means the new props-based scroll control is defined and the reported automatic scroll-to-top behavior can be controlled as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.