Button `disabled` unexpected behavior on Android
Nessuno ha ancora preso questa issue.
- Lingua principale
- C++
- Stelle
- 127k
- Fork
- 25.3k
- Merge medio
- 1g 23h
- PR unite (30g)
- 4
Descrizione
Description
On Android devices, the initial state of disabled for Button leads to unexpected behavior. When disabled is initially specified as true but later changes to false, the the background remains gray and disabled-like. This is unexpected behavior. This is not the case when disabled is initially specified as false.
Steps to reproduce
- Check out https://snack.expo.dev/@ctnelson1997/button-reset?platform=android
- Run on Android (Pixel 9 Pro used)
- When
useStatehas an initial value of0, the app works as expected. - When
useStatehas an initial value of5, and the reset button is pressed, the button still appearsdisabled. This is unexpected behavior.
React Native Version
0.81.5
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.22631
CPU: (14) x64 Intel(R) Core(TM) Ultra 5 125U
Memory: 2.98 GB / 15.46 GB
Binaries:
Node:
version: 22.19.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 10.9.3
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Disabled
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java:
version: 21.0.5
path: C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.81.5
wanted: 0.81.5
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
info React Native v0.82.1 is now available (your project is running on v0.81.5).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.82.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.81.5&to=0.82.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".
Stacktrace or Logs
N/A, issue is visual.
MANDATORY Reproducer
https://snack.expo.dev/@ctnelson1997/button-reset?platform=android
Screenshots and Videos
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo il riproduttore Snack obbligatorio su Android con i due valori iniziali di useState descritti nell’issue, quindi traccia l’implementazione Android di React Native Button. Il lavoro è completo quando la modifica di disabled da true a false dopo reset rimuove anche l’aspetto grigio dello stato disabilitato, mentre il comportamento esistente da false a false rimane invariato; aggiungi la copertura di regressione se viene identificato il punto di ingresso del test pertinente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, react-native
- Ambito
- mobile
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100