[AnalyticalTable]: Column filter popover closes on every selection with a popup-based custom Filter (e.g. MultiComboBox)
Maintainer thường phản hồi trong vòng 1 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ệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu tại packages/main/src/components/AnalyticalTable/defaults/Column/ColumnHeaderModal.tsx, nơi issue chỉ ra trình xử lý item-click và lệnh gọi setOpen(false) vô điều kiện. Kiểm tra cách các lần nhấp vào hàng bộ lọc khác với các thao tác sắp xếp, nhóm và cố định, sau đó tái hiện lỗi bằng một bộ lọc tùy chỉnh dựa trên popup như MultiComboBox. Công việc hoàn tất khi việc chọn giá trị bộ lọc vẫn giữ popover tiêu đề mở, trong khi các thao tác rõ ràng vẫn có thể đóng nó; payload không nêu tên tệp kiểm thử nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When a column uses a custom Filter that is a popup-based control (MultiComboBox, Select, ComboBox, DatePicker, …), the column-header popover closes on every selection. For a MultiComboBox this makes multi-selection practically unusable: the popover disappears after each picked item, so the user has to re-open it for every value.
Typing into the control does not close the popover — only selecting a value from its dropdown does.
Reproduction steps
- Render an
AnalyticalTablewithfilterableand a column whoseFilterrender-prop returns aMultiComboBox(withMultiComboBoxItemchildren) and callscolumn.setFilter(...)inonSelectionChange. - Open the column header → Filter.
- Open the
MultiComboBoxdropdown and select an item. - The column-header popover closes immediately.
Expected Behaviour
Selecting a value in a custom filter control should not close the column-header popover — at least not for multi-value controls. The popover should stay open so the user can pick multiple values, and close only on Escape, an outside click, or an explicit sort/group/freeze action.
Root cause
The popover is not closed by the ui5-popover's own light-dismiss — it is unmounted by React. In packages/main/src/components/AnalyticalTable/defaults/Column/ColumnHeaderModal.tsx, the List's item-click handler ends with an unconditional setOpen(false):
const handleModalItemClick = (e) => {
// ...sort / group / freeze branches, each keyed off e.detail.item.dataset...
setOpen(false); // ColumnHeaderModal.tsx:130 — runs for the filter row too
};
setOpen is the header cell's setPopoverOpen. The custom filter is rendered inside a clickable ListItemCustom (type="Active"), so selecting a value in the filter control surfaces an item-click on the filter row (which carries no data-sort / data-modal-item). The switch has no matching case, so execution falls through to the unconditional setOpen(false), which flips popoverOpen to false and unmounts the popover.
Because it is a React unmount rather than a native popover close, there is no before-close/close event — so onBeforeClose / modal cannot be used to prevent it.
Suggested fix
Skip setOpen(false) in handleModalItemClick when the clicked row is the filter row (no data-sort / data-modal-item), or render the filter's ListItemCustom as non-interactive. Either removes the need for any consumer workaround and fixes it for all popup-based custom filters.
Consumer workaround (until fixed)
Cancel the item-click for the filter row in the capture phase, using the popoverRef from the Filter render-prop:
const DepartmentFilter = ({ column, popoverRef }: ColumnFilterProps) => {
useEffect(() => {
const popover = popoverRef.current;
if (!popover) {
return;
}
const keepOpenOnFilterClick = (e: Event) => {
const item = (e as CustomEvent<{ item?: HTMLElement }>).detail?.item;
// filter row has no data-sort / data-modal-item marker
if (item && !item.dataset.sort && !item.dataset.modalItem) {
e.stopImmediatePropagation();
}
};
popover.addEventListener('item-click', keepOpenOnFilterClick, true);
return () => popover.removeEventListener('item-click', keepOpenOnFilterClick, true);
}, [popoverRef]);
// ...MultiComboBox with onSelectionChange -> column.setFilter(...)
};
Environment Info
- UI5 Web Components for React Version: 2.29.0
- UI5 Web Components Version: 2.29.0
- Browser: Chrome
- Operating System: macOS
Additional Context
Not specific to MultiComboBox — the same code path closes the popover for any popup-based custom filter (Select, ComboBox, DatePicker, …). It is simply most disruptive for MultiComboBox, where selecting multiple values in a row is the intended interaction. A plain text Input filter is unaffected (it has no dropdown to select from, so no item-click is fired).
- Ngôn ngữ chính
- TypeScript
- Star
- 544
- Fork
- 113
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 34
Chuẩn bị môi trường
- 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 UI5/webcomponents-react
-
[AnalyticalTable]: useF2CellEdit inserts "undefined" into grid-cell aria-labelCó thể đã có người làm @Lukas742 đã nhận 5 ngày trước. Đang mởSAP SF
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
UI5/webcomponents-react#9171 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[ObjectPage]: Scrollbar jumps to the focused section once go out and come back to the browser tabCó thể đã có người làm @Lukas742 đã nhận 11 ngày trước. Đang mởSAP SF
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
UI5/webcomponents-react#9161 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[ObjectPage]: page will twitch when the header height reaching the threshold of expansion and collapseCó thể đã có người làm @Lukas742 đã nhận 8 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
UI5/webcomponents-react#9128 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
UI5/webcomponents-react#8529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Design Pending SAP SF
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
UI5/webcomponents-react#8158 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của UI5/webcomponents-react
Issue tương tự
-
Độ 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 1 ngày
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
can1357/oh-my-pi#21349 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ 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
-
[aw] CARE PR Reviewer: timed outĐang mởagentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ohcnetwork/care_fe#17474 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100