Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Array field: no visible edit button on rows and no close button in the "Edit item" dialog

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

Maintainer thường phản hồi trong vòng 1 ngày

@bacarndiaye đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #1645 của @bacarndiaye — đang mở
  • #1647 của @MilindChatrabhuji — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

Start with ArrayFieldInput and ArrayFieldListView, which the issue identifies as the dialog and row implementations. Check how nearby fields use DialogContainer dismissal and ActionButton labels, then run the relevant array field tests. Done means each row exposes an edit action and accessible delete label, and the dialog can be dismissed by its header button and by clicking outside.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

For fields.array() with object (or any non-child) elements, the item editor is hard to discover and hard to leave with a pointer:

  1. List rows have no visible "edit" action. Each row only shows the drag handle and a trash button. Editing is only possible by clicking anywhere on the row, which is not obvious (no pencil icon, no tooltip, no button in the accessibility tree).
  2. The "Edit item" dialog has no close button. The only button is Done. Clicking outside the dialog does nothing; only the Esc key closes it, which is invisible to mouse and touch users.

Related: #1593 shows how fragile it is to rely on the whole-row click as the only way to open the dialog.

Reproduction

@keystatic/core 0.6.9, @keystatic/astro 6.0.0, Astro 7.4.1, Chromium.

import { config, fields, singleton } from '@keystatic/core';

export default config({
  storage: { kind: 'local' },
  singletons: {
    demo: singleton({
      label: 'Demo',
      path: 'src/data/demo',
      format: 'json',
      schema: {
        items: fields.array(
          fields.object({ title: fields.text({ label: 'Title' }) }),
          { label: 'Items', itemLabel: (props) => props.fields.title.value },
        ),
      },
    }),
  },
});
  1. Open /keystatic/singleton/demo, add two items.
  2. Look at the rows: only a drag handle and a trash icon.
  3. Click a row: the Edit item dialog opens with only a Done button.
  4. Click outside the dialog: it stays open. Press Esc: it closes.

Expected

  • A visible edit button (pencil icon with a tooltip, aria-label="Edit") on each row, next to delete. The edit string already exists in the locale strings.
  • A close ("Dismiss") button in the dialog header and outside-click dismissal.

Closing is safe: the dialog edits the item live, and Done only closes the dialog, so closing with the X is equivalent to Done (the same as Esc today).

Cause / suggested fix

  • ArrayFieldInput renders <DialogContainer onDismiss={...}> without isDismissable. @keystar/ui's Dialog/DialogContainer already support isDismissable, which renders a "Dismiss" ActionButton and enables dismissal by clicking the underlay.
  • ArrayFieldListView renders a single ActionButton (trash) per Item. Adding a second ActionButton with pencilIcon that calls onOpenItem(index) is enough. The trash button also has no aria-label (icon-only, tooltip only).

I verified both changes locally with a patch-package patch against 0.6.9 (compiled output):

-    t14 = jsx(DialogContainer, {
-      onDismiss: t12,
+    t14 = jsx(DialogContainer, {
+      onDismiss: t12,
+      isDismissable: true,
       children: t13
+ jsxs(Flex, { gridArea: "actions", alignItems: "center", gap: "small", children: [
+   /* TooltipTrigger > ActionButton aria-label={format('edit')} onPress={() => props.onOpenItem(props.elements.indexOf(item))} + pencilIcon */,
+   /* existing TooltipTrigger > ActionButton (trash), now with aria-label={format('delete')} */
+ ]})

With this, rows show pencil + trash, the dialog shows an X, and outside click closes it. Happy to open a PR against the source if this direction is acceptable.

Side note

The dialog title ("Edit item"), "Done", "Add" and "Empty list" are not localised even when locale is set (see #1578).

Ngôn ngữ chính
TypeScript
Star
2.5k
Fork
176
Merge trung bình
5 giờ 46 phút
Pull request đã merge (30 ngày)
3

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

  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.

Issue khác của Thinkmill/keystatic

Tất cả issue của Thinkmill/keystatic

Issue tương tự

Thêm issue về TypeScript

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.