Skip to content

Commit be992f3

Browse files
authored
[WC-3059] Dropdown overflow issue [2.27] (#1834)
2 parents d8b03d0 + 66c751c commit be992f3

File tree

8 files changed

+41
-39
lines changed

8 files changed

+41
-39
lines changed

automation/run-e2e/lib/update-test-project.mjs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,17 @@ import { join, resolve } from "node:path";
66
import sh from "shelljs";
77
import * as config from "./config.mjs";
88
import { fetchGithubRestAPI, fetchWithReport, packageMeta, streamPipe, usetmp } from "./utils.mjs";
9+
import { atlasCoreReleaseUrl } from "./config.mjs";
910

1011
const { cp, rm, mkdir, test } = sh;
1112

12-
async function getLatestReleaseByName(name, atlasCoreReleaseUrl) {
13-
const releasesResponse = await fetchGithubRestAPI(`${atlasCoreReleaseUrl}`);
14-
15-
if (!releasesResponse.ok) {
16-
throw new Error("Can't fetch releases");
17-
}
18-
19-
const releases = await releasesResponse.json();
20-
21-
if (!Array.isArray(releases)) {
22-
throw new Error("Releases response is not an array");
13+
async function getReleaseByTag(tag) {
14+
const url = `${atlasCoreReleaseUrl}/tags/${tag}`;
15+
const response = await fetchGithubRestAPI(url);
16+
if (!response.ok) {
17+
throw new Error(`Can't fetch release for tag: ${tag}`);
2318
}
24-
25-
const filteredReleases = releases.filter(release => release.name.toLowerCase().includes(name.toLowerCase()));
26-
27-
if (filteredReleases.length === 0) {
28-
throw new Error(`No releases found with name: ${name}`);
29-
}
30-
31-
return filteredReleases[0];
19+
return await response.json();
3220
}
3321

3422
async function downloadAndExtract(url, downloadPath, extractPath) {
@@ -47,10 +35,7 @@ async function updateAtlasThemeSource() {
4735

4836
rm("-rf", config.atlasDirsToRemove);
4937

50-
const release = await getLatestReleaseByName(
51-
"Atlas Core - Marketplace Release v3.17.0",
52-
config.atlasCoreReleaseUrl
53-
);
38+
const release = await getReleaseByTag("atlas-core-v3.17.0");
5439
const { browser_download_url } = release.assets[0];
5540
const downloadedPath = join(await usetmp(), config.nameForDownloadedAtlasCore);
5641
const outPath = await usetmp();
@@ -71,7 +56,9 @@ async function updateAtlasTheme() {
7156

7257
rm("-rf", "tests/testProject/theme");
7358

74-
const release = await getLatestReleaseByName("Atlas UI - Theme Folder Files", config.atlasCoreReleaseUrl);
59+
// Fetch the specific release by tag from GitHub API
60+
const tag = "atlasui-theme-files-2024-01-25";
61+
const release = await getReleaseByTag(tag);
7562

7663
if (!release) {
7764
throw new Error("Can't fetch latest Atlas UI theme release");

packages/modules/data-widgets/src/themesource/datawidgets/web/_datagrid-dropdown-filter.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ $root: ".widget-dropdown-filter";
106106
}
107107
}
108108

109+
&-menu-item-text {
110+
overflow: hidden;
111+
text-overflow: ellipsis;
112+
white-space: nowrap;
113+
}
114+
109115
&-checkbox-slot {
110116
display: flex;
111117
margin-inline-end: var(--wdf-outer-spacing);

packages/pluggableWidgets/datagrid-dropdown-filter-web/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We implemented ellipsis truncation to resolve option caption overflow issues.
12+
13+
- We fixed an issue where tooltips were not displayed correctly when hovering over options.
14+
915
## [2.27.0] - 2025-08-13
1016

1117
### Fixed

packages/pluggableWidgets/datagrid-dropdown-filter-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/datagrid-dropdown-filter-web",
33
"widgetName": "DatagridDropdownFilter",
4-
"version": "2.27.0",
4+
"version": "2.27.1",
55
"description": "",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/datagrid-dropdown-filter-web/src/DatagridDropdownFilter.editorConfig.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ export function getProperties(values: DatagridDropdownFilterPreviewProps, defaul
1717
hidePropertyIn(defaultProperties, values, "filterOptions");
1818
}
1919

20+
if (values.filterable || values.multiSelect) {
21+
// empty option is not shown when any of those are enabled
22+
hidePropertyIn(defaultProperties, values, "emptyOptionCaption");
23+
}
24+
2025
if (values.filterable) {
26+
// when it is filterable, we always imply clearable as true, so we hide the property
2127
hidePropertyIn(defaultProperties, values, "clearable");
22-
hidePropertyIn(defaultProperties, values, "emptyOptionCaption");
2328
} else {
29+
// when it is not filterable, we hide the caption for input as input is never shown
2430
hidePropertyIn(defaultProperties, values, "filterInputPlaceholderCaption");
2531
}
2632

packages/pluggableWidgets/datagrid-dropdown-filter-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="DatagridDropdownFilter" version="2.27.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="DatagridDropdownFilter" version="2.27.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="DatagridDropdownFilter.xml" />
66
</widgetFiles>

packages/shared/widget-plugin-filtering/src/controls/base/OptionsWrapper.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import { UseComboboxPropGetters, UseSelectPropGetters } from "downshift";
22
import { createElement, CSSProperties, forwardRef, ReactElement, RefObject } from "react";
33
import { OptionWithState } from "../../typings/OptionWithState";
4-
5-
type OptionsWrapperClassNamesProps = {
6-
popover?: string;
7-
menuSlot?: string;
8-
menu?: string;
9-
menuItem?: string;
10-
checkboxSlot?: string;
11-
checkbox?: string;
12-
};
4+
import { PickerCssClasses } from "../picker-primitives";
135

146
type OptionsWrapperProps = {
15-
cls: OptionsWrapperClassNamesProps;
7+
cls: PickerCssClasses;
168
style: CSSProperties;
179
onMenuScroll?: React.UIEventHandler<HTMLUListElement>;
1810
isOpen: boolean;
@@ -51,6 +43,7 @@ export const OptionsWrapper = forwardRef((props: OptionsWrapperProps, ref: RefOb
5143
data-highlighted={highlightedIndex === index || undefined}
5244
key={item.value || index}
5345
className={cls.menuItem}
46+
title={item.caption}
5447
{...getItemProps({
5548
item,
5649
index,
@@ -73,7 +66,7 @@ export const OptionsWrapper = forwardRef((props: OptionsWrapperProps, ref: RefOb
7366
/>
7467
</span>
7568
)}
76-
{item.caption || "\u00A0"}
69+
<span className={cls.menuItemText}>{item.caption || "\u00A0"}</span>
7770
</li>
7871
))}
7972
</ul>

packages/shared/widget-plugin-filtering/src/controls/picker-primitives.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type ClassKeys =
88
| "menu"
99
| "menuSlot"
1010
| "menuItem"
11+
| "menuItemText"
1112
| "menuCheckbox"
1213
| "checkboxSlot"
1314
| "popover"
@@ -19,7 +20,9 @@ type ClassKeys =
1920
| "separator"
2021
| "checkbox";
2122

22-
export function classes(rootName = "widget-dropdown-filter"): Record<ClassKeys, string> {
23+
export type PickerCssClasses = Record<ClassKeys, string>;
24+
25+
export function classes(rootName = "widget-dropdown-filter"): PickerCssClasses {
2326
return {
2427
root: rootName,
2528
input: `${rootName}-input`,
@@ -28,6 +31,7 @@ export function classes(rootName = "widget-dropdown-filter"): Record<ClassKeys,
2831
menu: `${rootName}-menu`,
2932
menuSlot: `${rootName}-menu-slot`,
3033
menuItem: `${rootName}-menu-item`,
34+
menuItemText: `${rootName}-menu-item-text`,
3135
menuCheckbox: `${rootName}-menu-checkbox`,
3236
checkboxSlot: `${rootName}-checkbox-slot`,
3337
popover: `${rootName}-popover`,

0 commit comments

Comments
 (0)