[AnalyticalTable]: Column filter popover closes on every selection with a popup-based custom Filter (e.g. MultiComboBox)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- react, typescript
- Domínio
- frontend
Direção de pesquisa
Comece em packages/main/src/components/AnalyticalTable/defaults/Column/ColumnHeaderModal.tsx, onde a issue aponta o manipulador item-click e a chamada incondicional a setOpen(false). Verifique como os cliques na linha de filtros diferem das ações de ordenação, agrupamento e congelamento, depois reproduza o problema com um filtro personalizado baseado em popup, como MultiComboBox. O trabalho estará concluído quando selecionar valores de filtro mantiver o popover do cabeçalho aberto, enquanto ações explícitas ainda puderem fechá-lo; o payload não menciona nenhum arquivo de teste.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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).
- Linguagem predominante
- TypeScript
- Estrelas
- 544
- Forks
- 113
- Merge médio
- 1d 16h
- PRs com merge (30d)
- 34
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de UI5/webcomponents-react
-
[AnalyticalTable]: useF2CellEdit inserts "undefined" into grid-cell aria-labelTalvez já em andamento @Lukas742 assumiu há 5 dias. AbertaSAP SF
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
UI5/webcomponents-react#9171 ·
Mantenedores costumam responder em até 1 dia
-
[ObjectPage]: Scrollbar jumps to the focused section once go out and come back to the browser tabTalvez já em andamento @Lukas742 assumiu há 11 dias. AbertaSAP SF
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
UI5/webcomponents-react#9161 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[ObjectPage]: page will twitch when the header height reaching the threshold of expansion and collapseTalvez já em andamento @Lukas742 assumiu há 8 dias. Aberta
Dificuldade 3/5 Meio dia Facilidade para iniciantes 55/100
UI5/webcomponents-react#9128 · 9 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
UI5/webcomponents-react#8529 ·
Mantenedores costumam responder em até 1 dia
-
Design Pending SAP SF
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
UI5/webcomponents-react#8158 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
Todas as issues de UI5/webcomponents-react
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
can1357/oh-my-pi#21349 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
agentic-workflows
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ohcnetwork/care_fe#17474 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100