Button remains unclickable after disabled state changes
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- android, javascript, react, react-native
- 領域
- frontend, mobile-dev
調査の方向性
提供されている html.button の Android 再現から始め、disabled 状態の処理を React Native Pressable と比較します。Android の実装を追跡し、disabled を true から false に戻す切り替えの回帰テストを追加します。完了条件は、ボタン自体とその子要素が再び押下に反応することです。
索引モデルが issue の本文から書いたものです。
説明
Describe the issue
On Android if html.button state is set to disabled and then back to enabled the pressable itself remains unclickable, while it's children are clickable as expected. As with other similar issues in React Native a workaround is to set a key based on disabled state, but this issue doesn't seem to come from React Native, as it doesn't happen in React Native.
On iOS the button regains clickability as expected.
Expected behavior
Like on iOS, the pressable on Android should become clickable when the disabled state changes back to false.
Steps to reproduce
Platform: Android
OS version: 16.0 ("Baklava"); API 36.0
React version: 19.2.3
React Native version: 0.85.3
RSD version: 0.0.55
- Use the below example:
import { useState } from "react";
import { Button, Pressable, Text, View } from "react-native";
import { css, html } from "react-strict-dom";
export default function RootLayout() {
const [buttonDisabled, setButtonDisabled] = useState(false);
const [rnPresses, setRnPresses] = useState(0);
const [rsdPresses, setRsdPresses] = useState(0);
return (
<View
style={{ flex: 1, backgroundColor: "white", alignItems: "center", justifyContent: "center" }}
>
<Button
title={"Toggle button disabled - now: " + buttonDisabled.toString()}
onPress={() => {
setButtonDisabled((prev) => !prev);
}}
/>
<View>
<Text>RN Pressable - {rnPresses} presses</Text>
<Pressable
disabled={buttonDisabled}
style={({ pressed }) => [
{ backgroundColor: "lightgreen", padding: 16 },
pressed && { opacity: 0.5 },
]}
onPress={() => {
setRnPresses((prev) => prev + 1);
}}
>
<Text style={{ backgroundColor: "black", color: "white", padding: 8 }}>Press me</Text>
</Pressable>
</View>
<View>
<Text>RSD Button - {rsdPresses} presses</Text>
<html.button
disabled={buttonDisabled}
style={styles.button}
onClick={() => {
setRsdPresses((prev) => prev + 1);
}}
>
<html.span style={styles.buttonText}>Press me</html.span>
</html.button>
</View>
</View>
);
}
const styles = css.create({
button: {
backgroundColor: "lightblue",
opacity: {
default: 1,
":active": 0.5,
},
padding: 16,
},
buttonText: {
backgroundColor: "black",
color: "white",
padding: 8,
},
});
- Run the app on Android device/emulator
- Verify that, for both RN and RSD cases, both pressable and it's children trigger press event (press count increases)
- Toggle button disabled state to true
- Toggle button disabled state to false
- Verify that for RN case both pressable and children regained clickability, while in RSD case only the label can be clicked to trigger an event
Test case
No response
Additional comments
No response
- 主要言語
- JavaScript
- スター
- 3.6k
- フォーク
- 208
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/react-strict-dom のほかの issue
-
Outline styles aren't parsed in React Native対応中かも @hoangvvo が 153 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
react/react-strict-dom#467 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
react/react-strict-dom#465 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 69/100
react/react-strict-dom#524 ·
-
postcss plugin re-transforms every included file on each rebuild under Turbopack (minutes-long HMR in large projects)対応中かも @borisyankov が 23 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
react/react-strict-dom#520 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
react/react-strict-dom#505 · リアクション 2 件 ·
react/react-strict-dom の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Add: EUROTV NEWSオープンchannels:add check:passed
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
curriculum documentation quality
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
githubnext/gh-aw-workshop#4638 ·
メンテナーはふだん 1 日以内に返信
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
openclaw/openclaw-enterprise#2571 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fabriziosalmi/certmate#1247 ·
メンテナーはふだん 1 日以内に返信