patternfly / patternfly/patternfly-react

Truncate - Update Truncate to pass in custom `tooltipContent`.

Đang mở
#12,033 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Stale
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ả

Is this a new component or an extension of an existing one?
The existing component is the [Truncate /] component.

Describe the feature
The feature is an enhancement to the PatternFly [Truncate /] component that allows a developer to customize or override the content of the tooltip that the component automatically provides.

Any other information?
The existing [Truncate /] component automatically adds a tooltip that displays the full, un-truncated text when the user hovers over the truncated element. This creates an issue when the developer needs to provide a custom tooltip (like one with a description and the full name) because it results in two tooltips appearing simultaneously. This blocks RHCLOUD-41396

The expected behavior is to add a new prop to [Truncate /]}}—perhaps called {{tooltipContent or a function prop that overrides it—that accepts either a string or an element as its value. When this new prop is used, the [Truncate /] component should display the custom content in its tooltip instead of the default un-truncated text. This allows for a single, customized tooltip to be shown when the text is truncated.

Are there visuals for this feature? If applicable, please include examples for each state and for varying widths
Include screenshots or links to Marvel or other mockups.

Example in use:

image


Jira Issue: PF-2757

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tìm component PatternFly Truncate hiện có và các test của component đó, sau đó đọc cách tooltip tự động hiện được cấu hình. Thêm API nội dung tooltip tùy chỉnh được yêu cầu cho các giá trị kiểu string hoặc element, rồi xác minh rằng nội dung tùy chỉnh thay thế toàn bộ văn bản mặc định mà không tạo ra hai tooltip.

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
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
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
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.