react-component / react-component/select

当作为基本的select时不应该focus和render input,因为会改变document 的 selection 和native select 行为不一致

Open
#1,022 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
938
Forks
482
Avg merge
15h 8m
Merged PRs (30d)
2

Description

当作为基本的select时不应该focus和render input,因为会改变document 的 selection 和native select 行为不一致

当select用在富文本编辑器中用于改变选中文本的字体,选项弹出时会清空当前选中的文字,而native select并不会,调试后发现是rc-select 生成的 input导致的。

如下图,选中文字再点select会取消选中,而native select并不会
image

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 from the rc-select input behavior described in the issue and reproduce it inside a rich-text editor with selected text, then compare the result with a native select. Trace which focus or input-rendering path clears document selection; done means opening a basic select preserves the existing text selection and matches native select behavior.

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
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.