ComboBox with selectionMode="multiple": Cmd/Ctrl+A does nothing while the popover is open

Đang mở Phù hợp với người mới
#10,866 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

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

Từ ngày 27/10/2026.

  • #10868 của @mangeshraut712 — đang mở

Đá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
76/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ệ
react, typescript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

Bắt đầu tại useComboBox, nơi issue cho biết useSelectableCollection xử lý sự kiện keydown của ô nhập liệu khi popover đang mở, rồi kiểm tra các bài kiểm thử ComboBox hiện có về thao tác bàn phím. Xác minh rằng Cmd/Ctrl+A chọn văn bản trong ô nhập liệu ở chế độ chọn nhiều khi popover đang mở, đồng thời giữ nguyên hành vi được ghi trong tài liệu của chế độ chọn đơn; thêm hoặc cập nhật một bài kiểm thử tập trung vào kết quả mong đợi.

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

Mô tả

Provide a general summary of the issue here

In a multi-select ComboBox, pressing Cmd+A / Ctrl+A doesn't select the text in the input while the popover is open. It doesn't select any options either, so the shortcut just does nothing.

🤔 Expected Behavior?

Cmd/Ctrl+A selects the text in the input, same as with selectionMode="single" or when the popover is closed.

😯 Current Behavior

Nothing happens. The keydown is default-prevented, so the browser doesn't select the text, and the selection doesn't change. As far as I can tell:

  • useComboBox applies the onKeyDown from useSelectableCollection to the input while the popover is open. It doesn't pass disallowSelectAll.
  • In multiple selection mode, useSelectableCollection handles Mod+A by calling manager.selectAll(). The handler returns undefined, so the event gets preventDefault().
  • selectAll() calls onSelectionChange('all'), and useComboBoxState ignores that (if (keys === 'all') return;).
💁 Possible Solution

Pass disallowSelectAll: true to useSelectableCollection in useComboBox. Select-all-options from a text field seems unexpected to me

🔦 Context

We use a multi-select ComboBox in forms. Users can't use Modl+A to clear or replace what they've typed in the filter input.

🖥️ Steps to Reproduce
<ComboBox selectionMode="multiple">
  <Label>Fruit</Label>
  <Input />
  <Button>▼</Button>
  <Popover>
    <ListBox>
      <ListBoxItem>Apple</ListBoxItem>
      <ListBoxItem>Banana</ListBoxItem>
      <ListBoxItem>Cherry</ListBoxItem>
    </ListBox>
  </Popover>
</ComboBox>
  1. Type "an" so the popover opens.
  2. Press Cmd/Ctrl+A. Nothing gets selected.
Version

react-aria-components 1.22.0

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

MacOS 26

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Ngôn ngữ chính
TypeScript
Star
16k
Fork
1.6k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

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 adobe/react-spectrum

Tất cả issue của adobe/react-spectrum

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.