patternfly / patternfly/patternfly-react

Bug - Code Editor - React basic read-only sample does not match HTML sample

未关闭 适合新手
#12,441 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Stale
主要语言
TypeScript
星标
862
派生
392
平均合并
4 天 8 小时
30 天内合并 PR
9

描述

Describe the problem
There is a visual styling mismatch between the React and HTML implementations of the Code Editor component in a read-only state. Specifically, the React "Basic" sample (when set to read-only) does not match the styling shown on the HTML "Read-only" version. The HTML version renders the code area with a distinct gray background to signify its read-only status, whereas the React version only applies a gray border, leaving the code area background white.

How do you reproduce the problem?

  • Navigate to the PatternFly React Code Editor documentation (https://www.patternfly.org/components/code-editor#basic).

  • View the "Basic" example or configure a basic Code Editor with the isReadOnly prop set to true.

  • Observe the background color of the code input area (it remains white/transparent with only a gray border).

  • Navigate to the PatternFly HTML Code Editor documentation (https://www.patternfly.org/components/code-editor/html#read-only).

  • Observe that the HTML version applies a full gray background variant (.pf-v5-c-code-editor.pf-m-read-only or equivalent utility) to the entire editor body.

Expected behavior
The React CodeEditor component should visually match the HTML implementation when isReadOnly is active. It should render with the full gray background variant across the code area, consistently indicating to the user that the text cannot be edited.

Is this issue blocking you?
No, it is not strictly blocking, but it creates visual inconsistency across our application's forms.
Workaround: Manually passing a custom class or inline styles to force the background color to match the PatternFly read-only token variables.

Screenshots

image

image

What is your environment?

  • OS: macOS Sonoma
  • Browser: Chrome
  • Version: 6.5.1

What is your product and what release date are you targeting?
RHOAI 3.5

Any other information?
It appears the React wrapper might not be mapping the isReadOnly prop to the correct modifier class (pf-m-read-only) on the outer container element that the HTML version utilizes.


Jira Issue: PF-4267

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从 React Code Editor Basic 示例及其 isReadOnly prop 开始,然后将其与 issue 中链接的 HTML Code Editor Read-only 示例进行比较。检查只读状态是否将 pf-m-read-only 样式应用于外部编辑器容器,并确认 React 代码区域是否具有与 HTML 版本相同的灰色背景。

由索引模型根据 Issue 内容生成。

评估

技术栈
react, typescript
领域
frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
基本清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。