Why does TextInput disabled outline return transparent in Dark theme (getOutlinedOutlineInputColor) ?
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- react-native, typescript
- 領域
- mobile
研究方向
先閱讀 TextInput 目錄中的 Helper.tsx 內的 getOutlinedOutlineInputColor,然後將深色與淺色主題的停用分支和回報的預期行為進行比較。當專案對深色主題的外框行為已有決定並完成文件化,且有一種獲接受的驗證或覆寫方式時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- TypeScript
- 星號
- 14.5k
- 分支
- 2.3k
- 平均合併
- 8 天 7 小時
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstack/react-native-paper 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
callstack/react-native-paper#5146 · 2 則留言 ·
維護者通常 3 天內回覆
-
Menu ignores the keyboard when it mounts while the keyboard is already open可能已有人在做 @manchoudhary 於 50 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
callstack/react-native-paper#5096 ·
維護者通常 3 天內回覆
-
Tooltip: onPress event object is not propagated to parent component on native可能已有人在做 @aliyilmaztech 於 83 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 74/100
callstack/react-native-paper#5003 ·
維護者通常 3 天內回覆
-
Snackbar stays mounted after `visible=false` under new architecture (iOS + Android)可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
callstack/react-native-paper#4951 ·
維護者通常 3 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
callstack/react-native-paper#4881 ·
維護者通常 3 天內回覆
查看 callstack/react-native-paper 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 85/100
formbricks/formbricks#9918 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 65/100
thecodacus/pithagoras#364 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 72/100
openclimatefix/quartz-frontend#823 ·
維護者通常 4 天內回覆
-
area:agent-manager community needs-triage
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
`contacts.create` posts to `/audiences/undefined/contacts` when `audienceId` is undefined可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
resend/resend-node#1176 ·
維護者通常 1 天內回覆