From 36a9241544d5a84d91f76fb2d1f16a021d357d3e Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Mon, 7 Jul 2025 17:23:26 +0200 Subject: [PATCH 1/2] feat(AnalyticalTable): add components that should not select a row when pressed --- .../components/AnalyticalTable/Recipes.mdx | 48 +++++++++++++++++-- .../components/AnalyticalTable/util/index.ts | 6 +++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/packages/main/src/components/AnalyticalTable/Recipes.mdx b/packages/main/src/components/AnalyticalTable/Recipes.mdx index fd7fbab6a2d..73382bac1a8 100644 --- a/packages/main/src/components/AnalyticalTable/Recipes.mdx +++ b/packages/main/src/components/AnalyticalTable/Recipes.mdx @@ -40,11 +40,53 @@ For further details please refer to the [`react-table` v7 documentation](https:/ ## How to select rows containing active elements? -We've restricted the propagation of `click` events of UI5 Web Components elements such as `Button`, `Link`, `Switch`, etc. -In case you still want to select the row when clicking the respective element, you can "mark" the event to allow such behavior.
+We've restricted the `click` events of UI5 Web Components elements such as `Button`, `Link`, `Switch`, etc. to not fire the `onRowSelect` or `onRowClick` events of the `AnalyticalTable`. This is to prevent unwanted selection or row click behavior when interacting with these elements. +In case you still want to select or click the row when clicking the respective element, you can "mark" the event to allow such behavior. + Example: ` {e.markerAllowTableRowSelection = true;}>My Link Text` -For other elements or components, we recommend disabling event propagation by setting `event.stopPropagation()` on the respective event. Per default, propagation is not prevented! +For other elements or components, we recommend either disabling event propagation by calling `event.stopPropagation()` in the respective handler, or checking for the target. **Per default, propagation is not prevented!** + +
+ + UI5 Web Components that Block Row Selection by Default + + - UI5-AI-BUTTON + - UI5-AI-PROMPT-INPUT + - UI5-AVATAR + - UI5-BUTTON + - UI5-CALENDAR + - UI5-CHECKBOX + - UI5-COLOR-PICKER + - UI5-COMBOBOX + - UI5-DATE-PICKER + - UI5-DATERANGE-PICKER + - UI5-DATETIME-PICKER + - UI5-DURATION-PICKER + - UI5-DYNAMIC-DATE-Range + - UI5-FILE-UPLOADER + - UI5-ICON + - UI5-INPUT + - UI5-LINK + - UI5-MENU-ITEM + - UI5-MENU-ITEM-GROUP + - UI5-MULTI-COMBOBOX + - UI5-MULTI-INPUT + - UI5-RADIO-BUTTON + - UI5-RANGE-SLIDER + - UI5-RATING-INDICATOR + - UI5-SEGMENTED-BUTTON + - UI5-SELECT + - UI5-SLIDER + - UI5-SPLIT-BUTTON + - UI5-STEP-INPUT + - UI5-SWITCH + - UI5-TEXT-AREA + - UI5-TIME-PICKER + - UI5-TOGGLE-BUTTON + - UI5-UPLOAD-COLLECTION + +
## How to stop the table state from automatically resetting when the data changes? diff --git a/packages/main/src/components/AnalyticalTable/util/index.ts b/packages/main/src/components/AnalyticalTable/util/index.ts index 0516426760a..ffb0ce28880 100644 --- a/packages/main/src/components/AnalyticalTable/util/index.ts +++ b/packages/main/src/components/AnalyticalTable/util/index.ts @@ -60,6 +60,8 @@ export function getBy(obj, path, def) { } export const tagNamesWhichShouldNotSelectARow = new Set([ + 'UI5-AI-BUTTON', + 'UI5-AI-PROMPT-INPUT', 'UI5-AVATAR', 'UI5-BUTTON', 'UI5-CALENDAR', @@ -70,10 +72,13 @@ export const tagNamesWhichShouldNotSelectARow = new Set([ 'UI5-DATERANGE-PICKER', 'UI5-DATETIME-PICKER', 'UI5-DURATION-PICKER', + 'UI5-DYNAMIC-DATE-Range', 'UI5-FILE-UPLOADER', 'UI5-ICON', 'UI5-INPUT', 'UI5-LINK', + 'UI5-MENU-ITEM', + 'UI5-MENU-ITEM-GROUP', 'UI5-MULTI-COMBOBOX', 'UI5-MULTI-INPUT', 'UI5-RADIO-BUTTON', @@ -82,6 +87,7 @@ export const tagNamesWhichShouldNotSelectARow = new Set([ 'UI5-SEGMENTED-BUTTON', 'UI5-SELECT', 'UI5-SLIDER', + 'UI5-SPLIT-BUTTON', 'UI5-STEP-INPUT', 'UI5-SWITCH', 'UI5-TEXT-AREA', From 3d3d04d4f0aca20aeb43d2b1c23a93ea47750fc4 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Mon, 7 Jul 2025 17:25:49 +0200 Subject: [PATCH 2/2] typo --- packages/main/src/components/AnalyticalTable/Recipes.mdx | 2 +- packages/main/src/components/AnalyticalTable/util/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/main/src/components/AnalyticalTable/Recipes.mdx b/packages/main/src/components/AnalyticalTable/Recipes.mdx index 73382bac1a8..fddd915c352 100644 --- a/packages/main/src/components/AnalyticalTable/Recipes.mdx +++ b/packages/main/src/components/AnalyticalTable/Recipes.mdx @@ -63,7 +63,7 @@ For other elements or components, we recommend either disabling event propagatio - UI5-DATERANGE-PICKER - UI5-DATETIME-PICKER - UI5-DURATION-PICKER - - UI5-DYNAMIC-DATE-Range + - UI5-DYNAMIC-DATE-RANGE - UI5-FILE-UPLOADER - UI5-ICON - UI5-INPUT diff --git a/packages/main/src/components/AnalyticalTable/util/index.ts b/packages/main/src/components/AnalyticalTable/util/index.ts index ffb0ce28880..69fb05a178c 100644 --- a/packages/main/src/components/AnalyticalTable/util/index.ts +++ b/packages/main/src/components/AnalyticalTable/util/index.ts @@ -72,7 +72,7 @@ export const tagNamesWhichShouldNotSelectARow = new Set([ 'UI5-DATERANGE-PICKER', 'UI5-DATETIME-PICKER', 'UI5-DURATION-PICKER', - 'UI5-DYNAMIC-DATE-Range', + 'UI5-DYNAMIC-DATE-RANGE', 'UI5-FILE-UPLOADER', 'UI5-ICON', 'UI5-INPUT',