Bard: dropdown menu of a newly inserted set closes immediately (can't delete/collapse/duplicate the set)
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #15709 của @o1y — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start by tracing the Bard set dropdown and its node view, then inspect how ProseMirror's DOMObserver handles the aria-hidden attribute mutations described in the issue. Reproduce by inserting a set containing a Grid and opening its menu; compare the newly inserted set with a saved and reloaded set. Done means the menu stays open after insertion and its actions work without losing the node view.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug description
After inserting a new set into a Bard field, the set's "…" dropdown (Collapse / Duplicate / Delete Set) does not open. Clicking the trigger does nothing visible. The same happens for dropdowns inside the set, e.g. the row actions of a Grid field within the set.
Sets that were already saved are not affected. Their dropdown opens normally, even when expanded or after their fields were edited. Once the entry is saved and reloaded, the dropdown of the previously "new" set works again.
Expected: the dropdown opens and the set can be deleted right after inserting it.
What I found while debugging:
- The set's dropdown is a modal Reka dropdown (
DropdownMenuRootContext.modal === true). - Clicking the trigger sets
opentotrue. The menu content is mounted intobodyand removed again in the same tick. - At that moment
aria-hidden/data-aria-hiddenget set on the editor's top-level children (h1,p,h2, … inside.ProseMirror), apparently from the modal "hide others" behaviour. - ProseMirror's
DOMObserverregisters these attribute mutations as DOM changes and marks the range dirty.DOMObserver.flush()→view.updateState()→docView.updateChildren()→destroyRest()then destroys the set's node view. No transaction is dispatched. - The Vue component of the set (including the open dropdown) is unmounted and a fresh instance is rendered with the dropdown closed.
So the modal dropdown mutates attributes inside the ProseMirror DOM, ProseMirror re-renders that range, and the re-render destroys the node view that owns the dropdown. For saved sets the node view seems to survive the re-render, which is why only freshly inserted sets are affected.
How to reproduce
-
Create a Bard field with a set containing a Grid (any fields will do), e.g.:
handle: text field: type: bard sets: main: sets: buttons: fields: - handle: buttons field: type: grid min_rows: 1 fields: - { handle: label, field: { type: text } } - { handle: link, field: { type: link } } -
Open an entry with this field in the CP.
-
Place the cursor on an empty line in the Bard field and insert the set.
-
Click the "…" button in the header of the newly inserted set.
-
The dropdown does not open, so the set can't be deleted, collapsed or duplicated.
-
Save and reload the entry, then click "…" again. Now the dropdown opens.
Logs
Environment
Environment
Laravel Version: 13.38.0
PHP Version: 8.5.12
Composer Version: 2.10.3
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: Europe/Berlin
Locale: de
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED
Drivers
Broadcasting: null
Cache: file
Database: sqlite
Logs: debug / single
Mail: sendmail
Queue: sync
Session: file
Storage
public/storage: LINKED
Statamic
Addons: 5
License Key: Not set
Sites: 5 (German, English (US), English, Hungary, Spanish)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.36.0 PRO
Statamic Addons
heidkaemper/statamic-toolbar: 1.7.0
jacksleight/statamic-bard-texstyle: 4.2.4
ndx/statamic-bard-color-picker: 3.1.0
ndx/statamic-simple-redirects: 1.4.0
spatie/statamic-responsive-images: 6.2.0
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
- Ngôn ngữ chính
- PHP
- Star
- 4.9k
- Fork
- 647
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 138
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 statamic/cms
-
Setting up URL to a custom elevated session page in config/statamic/users.php won't work in CpĐang mởauth needs more info
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
statamic/cms#15698 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make native filesystem directory permissions configurable to support shared POSIX ACL accessĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[7.x] Reintroduce parser error for mixed pipe/shorthand modifier syntaxCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởantlers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
caching nocache
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
statamic/cms#15643 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Awaiting Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
reproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anomalyco/opencode#58664 · 1 bình luận ·
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 87/100
WordPress/phpunit-test-runner#364 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
domain/framework Platform(Default) priority/high
Độ 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