patternfly / patternfly/patternfly-react
Bug - Code Editor - React basic read-only sample does not match HTML sample
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 862
- Fork
- 392
- Merge trung bình
- 4 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
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
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với ví dụ React Code Editor Basic và prop isReadOnly của nó, sau đó so sánh với ví dụ HTML Code Editor Read-only được liên kết trong issue. Kiểm tra xem trạng thái chỉ đọc có áp dụng kiểu pf-m-read-only cho container bên ngoài của trình chỉnh sửa hay không, đồng thời xác minh rằng vùng mã React có cùng nền màu xám như phiên bản HTML.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 65/100