callstack / callstack/react-native-paper
Why does TextInput disabled outline return transparent in Dark theme (getOutlinedOutlineInputColor) ?
- Lingua principale
- TypeScript
- Stelle
- 14.5k
- Fork
- 2.2k
- Merge medio
- 5g 23h
- PR unite (30g)
- 12
Descrizione
### Ask your Question
While using TextInput (mode="outlined") in React Native Paper with a custom dark theme, I noticed that disabled inputs don’t render an outline border.
After checking the source code, the reason seems to come from getOutlinedOutlineInputColor in Helper.tsx inside the TextInput directory :
```
const getOutlinedOutlineInputColor = ({
theme,
disabled,
customOutlineColor,
}: BaseProps & { customOutlineColor?: string }) => {
const isTransparent = color(customOutlineColor).alpha() === 0;
if (!disabled && customOutlineColor) {
return customOutlineColor;
}
if (theme.isV3) {
if (disabled) {
if (theme.dark) {
return 'transparent';
}
return theme.colors.surfaceDisabled;
}
return theme.colors.outline;
}
if (disabled) {
if (isTransparent) {
return customOutlineColor;
}
return theme.colors.disabled;
}
return theme.colors.placeholder;
};
```
My Expectation
In dark mode, I would expect the disabled border to use something like theme.colors.surfaceDisabled (similar to light mode), instead of transparent.
This way, the outline remains visible and consistent with Material guidelines.
Question
Is the transparent return for dark mode intentional?
If yes, what’s the recommended way to override it so that disabled inputs still have a visible outline in dark theme?
Would you accept a PR that aligns the behavior with light mode (surfaceDisabled)?
Environment
react-native-paper: 5.14.5
react-native: 0.79.5
Platform: Android & iOS
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia leggendo getOutlinedOutlineInputColor in Helper.tsx all’interno della directory TextInput, quindi confronta i rami disabilitati dei temi scuro e chiaro con il comportamento previsto segnalato. Il lavoro è completato quando il progetto ha un comportamento deciso e documentato per il contorno del tema scuro e un modo accettato per verificarlo o sovrascriverlo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react-native, typescript
- Ambito
- mobile
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100