[AnalyticalTable]: Column filter popover closes on every selection with a popup-based custom Filter (e.g. MultiComboBox)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 82/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- react, typescript
- Domaine
- frontend
Piste de recherche
Commencez dans packages/main/src/components/AnalyticalTable/defaults/Column/ColumnHeaderModal.tsx, où l’issue identifie le gestionnaire item-click et l’appel inconditionnel à setOpen(false). Vérifiez en quoi les clics sur la ligne de filtres diffèrent des actions de tri, de regroupement et de gel, puis reproduisez le problème avec un filtre personnalisé reposant sur une popup, tel que MultiComboBox. Le travail est terminé lorsque la sélection de valeurs de filtre laisse ouvert le popover de l’en-tête, tandis que les actions explicites peuvent toujours le fermer ; le payload ne mentionne aucun fichier de test.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- TypeScript
- Étoiles
- 544
- Forks
- 113
- Merge moyen
- 1 j 16 h
- PR mergées (30 j)
- 34
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de UI5/webcomponents-react
-
[AnalyticalTable]: useF2CellEdit inserts "undefined" into grid-cell aria-labelPeut-être pris @Lukas742 l’a pris il y a 5 jours. OuverteSAP SF
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
UI5/webcomponents-react#9171 ·
Les mainteneurs répondent en général sous 1 jour
-
[ObjectPage]: Scrollbar jumps to the focused section once go out and come back to the browser tabPeut-être pris @Lukas742 l’a pris il y a 11 jours. OuverteSAP SF
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
UI5/webcomponents-react#9161 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[ObjectPage]: page will twitch when the header height reaching the threshold of expansion and collapsePeut-être pris @Lukas742 l’a pris il y a 8 jours. Ouverte
Difficulté 3/5 Une demi-journée Accessibilité débutants 55/100
UI5/webcomponents-react#9128 · 9 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
UI5/webcomponents-react#8529 ·
Les mainteneurs répondent en général sous 1 jour
-
Design Pending SAP SF
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
UI5/webcomponents-react#8158 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de UI5/webcomponents-react
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
can1357/oh-my-pi#21349 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours
-
[aw] CARE PR Reviewer: timed outOuverteagentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ohcnetwork/care_fe#17474 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100