Tencent / Tencent/tdesign-react

[Textarea] 的粘贴事件有问题,无法获得粘贴的文件

Open
#3,849 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐞 bug usage
Dominant language
TypeScript
Stars
965
Forks
373
Avg merge
3d 6h
Merged PRs (30d)
17

Description

tdesign-react 版本

重现链接

No response

重现步骤

粘贴系统文件时,不管是 onPaste 或者是 onPasteCapture 事件,都无法获取到 e.clipboardData

import { Textarea } from 'tdesign-react'

function App() {

  const handlePaste = (content: string, e: React.ClipboardEvent<HTMLTextAreaElement>) => {
    console.log('handlePaste',[content, e, e.clipboardData])
  }
  const handlePasteCapture = (content: string, e: React.ClipboardEvent<HTMLTextAreaElement>) => {
    console.log('handlePasteCapture',[content, e, e.clipboardData])
  }
  return (
    <>
      <div>
        <Textarea onPaste={handlePaste} onPasteCapture={handlePasteCapture} />
      </div>
    </>
  )
}
期望结果

No response

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Contributor guide

Open the contributing guide

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 at the Textarea component's paste event entry point and reproduce the issue with the provided TypeScript example. Inspect how onPaste and onPasteCapture arguments are assembled, then verify that the resulting event exposes clipboardData when a system file is pasted.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.