Controlled input keeps text that onChange rejected (no setState)
メンテナーはふだん 1 日以内に返信
@bilalvur がすでに取り組んでいます。
2026年10月30日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- playwright, react, typescript, vite
- 領域
- frontend
調査の方向性
Start by tracing how Redact handles controlled input values and change events; compare that path with React using the supplied main.js reproduction. Build and preview with Vite, then type 1a2 and confirm the input displays 12 when onChange rejects the change. The issue names no repository source files or tests, so locate the relevant implementation and regression test first.
索引モデルが issue の本文から書いたものです。
説明
What happens
A controlled input whose onChange rejects a change by not calling setState keeps the typed text. React writes the controlled value back after the event, so the input never shows rejected text. Redact leaves it in the DOM, out of sync with state.
Typing 1a2 into the input below:
- React 19.3.1:
12 - Redact 0.2.3:
1a2
Same result in Chromium 156, Firefox 157 and WebKit 27.2 (Playwright 1.64.1, production build). Redact 0.1.4, 0.1.5, 0.2.0 and 0.2.1 behave the same, so it is not a 0.2 regression. #64 is also about controlled text inputs, but a different symptom.
We hit it in a form field that ignores input not starting with a number.
Reproduction
package.json
{
"name": "redact-controlled-input-repro",
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"preview": "vite preview --host 127.0.0.1"
},
"dependencies": {
"@tanstack/redact": "0.2.3",
"react": "19.3.1",
"react-dom": "19.3.1"
},
"devDependencies": {
"vite": "8.3.4"
}
}
index.html
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Controlled input reproduction</title></head>
<body><div id="root"></div><script type="module" src="/main.js"></script></body>
</html>
vite.config.js
import { redact } from '@tanstack/redact/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: process.env.NO_REDACT ? [] : [redact()],
})
main.js
import { createElement, useState } from 'react'
import { createRoot } from 'react-dom/client'
function Digits() {
const [value, setValue] = useState('')
return createElement('input', {
value,
onChange: (event) => {
if (/^\d*$/.test(event.target.value)) setValue(event.target.value)
},
})
}
createRoot(document.getElementById('root')).render(createElement(Digits))
Run npm install && npm run build && npm run preview, then type 1a2. With NO_REDACT=1 npm run build it shows 12.
I used Claude Code to narrow this down from our app and to run the repro across browsers and versions.
- 主要言語
- TypeScript
- スター
- 581
- フォーク
- 28
- 平均マージ
- 13時間 48分
- マージ済み PR(30日)
- 45
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/redact のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TanStack/redact#142 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
TanStack/redact の issue をすべて見る
似ている issue
-
inference/go type/feature
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#65148 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
truapi-release
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
paritytech/product-sdk#529 ·
メンテナーはふだん 1 日以内に返信
-
Add: Mansudae TVオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
devlikeapro/waha#2369 ·
メンテナーはふだん 5 日以内に返信