Apps configuration page scrolls to the bottom on load when a field hint contains a code block
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- angular, javascript, typescript
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
Bắt đầu với directive được nêu tại core-web/apps/dotcms-ui/src/app/portlets/dot-apps/components/dot-apps-configuration-detail/directives/dot-apps-code-block.directive.ts và theo dõi cách nó tạo rồi chèn DotCopyButtonComponent. Thêm hoặc tìm một unit test cho luồng chèn này. Công việc hoàn tất khi nút sao chép được chèn không có thuộc tính autofocus, mã vẫn được sao chép và các tiêu chí chấp nhận đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem Statement
When an App's configuration page loads, it scrolls down to the "Advanced Configuration (JSON)" field instead of staying at the top. Users land in the middle of the form and have to scroll back up to see the first fields. You can see it on the Content Analytics App.
The jump happens because the copy button inside the hint's code block gets focus by itself.
- The
dotAppsCodeBlocksdirective turns each code block in a markdown hint into a box with a copy button (DotCopyButtonComponent). It renders that button outside the page withcreateComponent()and then inserts it. - PrimeNG's
p-buttonaddsautofocus="true"to its inner<button>whenever itsautofocusinput is not set. ItsAutoFocusdirective only removes the attribute when it gets exactlyfalse, and an unset input arrives asundefined. - The browser focuses an element that is inserted into the page with
autofocusalready on it, and scrolls to it. Buttons that were already on the page don't trigger this. This one does, because it is inserted after being rendered.
This affects any App whose YAML puts a fenced code block in a field hint. The App YAML has no setting that controls this; the fix has to be in the frontend.
https://github.com/user-attachments/assets/67afb58c-9907-49c3-96e1-1bc5f36cc03a
Steps to Reproduce
- Go to Apps → Content Analytics and create a configuration for the System Host (
/dotAdmin/#/apps/dotContentAnalytics-config/create/SYSTEM_HOST). - Wait for the form to load.
- Notice that the page scrolls to "Advanced Configuration (JSON)".
- In DevTools,
document.activeElementis the code block's copy button and hasautofocus="true".
Acceptance Criteria
- An App configuration page opens scrolled to the top, even when a field hint contains a code block.
- Nothing in the hint's code block takes focus on page load.
- The copy button in the code block still shows and copies the code.
- A unit test covers that the copy button created by
dotAppsCodeBlockshas noautofocusattribute when it is inserted.
dotCMS Version
main (introduced with the code block directive in #37897).
Severity
Low - Minor issue or cosmetic
Links
- PR that added the directive: #37897
- Directive:
core-web/apps/dotcms-ui/src/app/portlets/dot-apps/components/dot-apps-configuration-detail/directives/dot-apps-code-block.directive.ts - App descriptor where it shows up:
dotCMS/src/main/resources/apps/dotContentAnalytics-config.yml(thehintofadvancedConfig)
- Ngôn ngữ chính
- Java
- Star
- 972
- Fork
- 493
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 237
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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.
Issue khác của dotCMS/core
-
OKR : Customer Support Team : Maintenance Type : Defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Opening content from Content Search replaces the "Search" breadcrumb in the new Edit Content screenĐang mởdotCMS: New Edit Contentlet OKR : Customer Support Team : Falcon Type : Defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Escape the Binary field hint in the legacy content editor so an apostrophe doesn't break the fieldĐang mởOKR : Customer Support Team : Maintenance Type : Defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 2 ngày
-
dotCMS : Permissions OKR : Customer Support Team : Maintenance Type : Defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
OKR : Customer Support Team : Maintenance Type : Defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
it-at-m/Wahllokalsystem#3846 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Area/Connector module/solace Priority/Low Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
ballerina-platform/ballerina-library#9849 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Vakore/ZappierGames#327 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexCó thể đã có người làm @matthewalberto đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
mit-cml/appinventor-sources#4246 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày