[AnalyticalTable]: Column filter popover closes on every selection with a popup-based custom Filter (e.g. MultiComboBox)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 82/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- react, typescript
- 領域
- frontend
研究方向
從 packages/main/src/components/AnalyticalTable/defaults/Column/ColumnHeaderModal.tsx 開始,issue 在此指出了 item-click 處理常式和無條件呼叫的 setOpen(false)。檢查篩選列的點擊與排序、分組和凍結操作有何不同,接著使用 MultiComboBox 這類以彈出視窗為基礎的自訂篩選器重現問題。完成標準是:選取篩選值時標題彈出視窗保持開啟,而明確操作仍可將其關閉;payload 未提及任何測試檔案。
由索引模型根據 Issue 內容生成。
描述
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).
- 主要語言
- TypeScript
- 星號
- 544
- 分支
- 113
- 平均合併
- 1 天 16 小時
- 30 天內合併 PR
- 34
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
UI5/webcomponents-react 的其他 Issue
-
[AnalyticalTable]: useF2CellEdit inserts "undefined" into grid-cell aria-label可能已有人在做 @Lukas742 於 5 天前認領。 未關閉SAP SF
難度 2/5 1-3 小時 新手友好度 74/100
UI5/webcomponents-react#9171 ·
維護者通常 1 天內回覆
-
[ObjectPage]: Scrollbar jumps to the focused section once go out and come back to the browser tab可能已有人在做 @Lukas742 於 11 天前認領。 未關閉SAP SF
難度 3/5 1-2 天 新手友好度 57/100
UI5/webcomponents-react#9161 · 1 則留言 ·
維護者通常 1 天內回覆
-
[ObjectPage]: page will twitch when the header height reaching the threshold of expansion and collapse可能已有人在做 @Lukas742 於 8 天前認領。 未關閉
難度 3/5 半天 新手友好度 55/100
UI5/webcomponents-react#9128 · 9 則留言 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 20/100
UI5/webcomponents-react#8529 ·
維護者通常 1 天內回覆
-
Design Pending SAP SF
難度 3/5 1-2 天 新手友好度 45/100
UI5/webcomponents-react#8158 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
查看 UI5/webcomponents-react 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
難度 2/5 1-3 小時 新手友好度 78/100
can1357/oh-my-pi#21349 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 2 天內回覆
-
agentic-workflows
難度 2/5 1-3 小時 新手友好度 72/100
ohcnetwork/care_fe#17474 ·
維護者通常 1 天內回覆
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 90/100