Skip to content

Commit 87dbb0e

Browse files
committed
fix: make the "select all button" disabled when there are no items in the list
1 parent 5b517b9 commit 87dbb0e

File tree

6 files changed

+80
-57
lines changed

6 files changed

+80
-57
lines changed

packages/pluggableWidgets/combobox-web/CHANGELOG.md

+53-49
Original file line numberDiff line numberDiff line change
@@ -6,216 +6,220 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- We improved the combobox behavior by disabling the Select All checkbox when no items are available.
12+
913
## [2.3.0] - 2025-03-19
1014

1115
### Changed
1216

13-
- The type of the "Aria required" setting has been changed from a boolean to an expression. When the widget is updated, the previously set value is reset to false.
17+
- The type of the "Aria required" setting has been changed from a boolean to an expression. When the widget is updated, the previously set value is reset to false.
1418

1519
## [2.2.0] - 2025-02-04
1620

1721
### Added
1822

19-
- We added a new "Selected items sorting" property to set the display order of the selected items. "Caption" based sorting display for selected items now possible for combobox with multiple selection.
23+
- We added a new "Selected items sorting" property to set the display order of the selected items. "Caption" based sorting display for selected items now possible for combobox with multiple selection.
2024

2125
### Changed
2226

23-
- Database multi selection will no longer display selected value sorted by the caption. The default behavior is to display them based on selection order, unless the new "Selected items sorting" configurations are set to "Caption".
27+
- Database multi selection will no longer display selected value sorted by the caption. The default behavior is to display them based on selection order, unless the new "Selected items sorting" configurations are set to "Caption".
2428

2529
## [2.1.4] - 2025-01-29
2630

2731
### Fixed
2832

29-
- We fixed an issue where combobox does not show initial caption correctly for database source.
33+
- We fixed an issue where combobox does not show initial caption correctly for database source.
3034

31-
- We fixed an issue where combobox caption expression does not load correctly.
35+
- We fixed an issue where combobox caption expression does not load correctly.
3236

3337
### Changed
3438

35-
- We remove default value from database source configuration.
39+
- We remove default value from database source configuration.
3640

3741
## [2.1.3] - 2024-12-11
3842

3943
### Fixed
4044

41-
- We fixed an issue where placeholder failed to shown on database source.
45+
- We fixed an issue where placeholder failed to shown on database source.
4246

4347
## [2.1.2] - 2024-12-09
4448

4549
### Fixed
4650

47-
- We fixed an issue where onchange event on database source triggered directly onload.
51+
- We fixed an issue where onchange event on database source triggered directly onload.
4852

49-
- We fixed an issue where selected value sometimes shows unavailable text on lazy loaded content.
53+
- We fixed an issue where selected value sometimes shows unavailable text on lazy loaded content.
5054

5155
## [2.1.1] - 2024-11-15
5256

5357
### Fixed
5458

55-
- We fixed an issue where database optional value attribute breaks on runtime when not being set.
59+
- We fixed an issue where database optional value attribute breaks on runtime when not being set.
5660

57-
- We fixed an issue where custom content not shown on design preview and runtime for database datasource.
61+
- We fixed an issue where custom content not shown on design preview and runtime for database datasource.
5862

5963
## [2.1.0] - 2024-10-29
6064

6165
### Added
6266

63-
- We added support for attribute with **Long** type.
67+
- We added support for attribute with **Long** type.
6468

6569
### Changed
6670

67-
- We make **Value** no longer required if the **Target attribute** is not set for database datasource.
71+
- We make **Value** no longer required if the **Target attribute** is not set for database datasource.
6872

69-
- We restructure **Attribute** group configuration and rename it as **Store value**.
73+
- We restructure **Attribute** group configuration and rename it as **Store value**.
7074

7175
## [2.0.2] - 2024-10-03
7276

7377
### Fixed
7478

75-
- We fixed an issue where the onChange event was not being triggered when selecting an item for the first time.
79+
- We fixed an issue where the onChange event was not being triggered when selecting an item for the first time.
7680

77-
- We fixed an issue where the combo box values would not refresh after toggling its read-only state.
81+
- We fixed an issue where the combo box values would not refresh after toggling its read-only state.
7882

7983
## [2.0.1] - 2024-08-16
8084

8185
### Fixed
8286

83-
- We fixed an issue with the toolbar visibility when a combobox menu overlays it.
87+
- We fixed an issue with the toolbar visibility when a combobox menu overlays it.
8488

8589
## [2.0.0] - 2024-08-09
8690

8791
### Added
8892

89-
- We added the ability to auto label combobox, based on the set attributes.
93+
- We added the ability to auto label combobox, based on the set attributes.
9094

91-
- We implement the selection API for combobox that use database datasource, which allows the widget selection to be listened into.
95+
- We implement the selection API for combobox that use database datasource, which allows the widget selection to be listened into.
9296

9397
### Fixed
9498

95-
- We fixed a11y issue where aria-required not applied in the widget.
99+
- We fixed a11y issue where aria-required not applied in the widget.
96100

97101
## [1.6.3] - 2024-08-07
98102

99103
### Added
100104

101-
- We added a new filter type, 'Contains (exact),' as an option to provide a more strict search ranking.
105+
- We added a new filter type, 'Contains (exact),' as an option to provide a more strict search ranking.
102106

103107
## [1.6.2] - 2024-07-16
104108

105109
### Changed
106110

107-
- Due to technical limitation, it is not possible to use lazy load on caption type = expression. Thus, we removed lazy loading for this configuration.
111+
- Due to technical limitation, it is not possible to use lazy load on caption type = expression. Thus, we removed lazy loading for this configuration.
108112

109113
## [1.6.1] - 2024-06-28
110114

111115
### Changed
112116

113-
- We changed the default value for lazy loading. From now on, lazy loading will be true by default.
117+
- We changed the default value for lazy loading. From now on, lazy loading will be true by default.
114118

115-
- We fixed an issue where in some cases the clear button is rendered outside of a combobox.
119+
- We fixed an issue where in some cases the clear button is rendered outside of a combobox.
116120

117121
## [1.6.0] - 2024-06-19
118122

119123
### Changed
120124

121-
- We changed how input filtering works for lazy loading. if set to true, then the filter will works by retrieving directly from datasource, otherwise it works by scanning the current loaded data.
125+
- We changed how input filtering works for lazy loading. if set to true, then the filter will works by retrieving directly from datasource, otherwise it works by scanning the current loaded data.
122126

123127
### Added
124128

125-
- We added Spinner and Skeleton loaders in addition to lazy loading feature. The default loader is spinner, and skeleton can also be selected. This improves UX when loading more content.
129+
- We added Spinner and Skeleton loaders in addition to lazy loading feature. The default loader is spinner, and skeleton can also be selected. This improves UX when loading more content.
126130

127-
- We added lazy loading feature. By default it is turned off. When turned on, the items will be loaded in batches when scrolling.
131+
- We added lazy loading feature. By default it is turned off. When turned on, the items will be loaded in batches when scrolling.
128132

129133
## # Breaking
130134

131-
- The Combo box now uses Atlas variables for its styling. This may change how the widget looks depending on the custom variables.
135+
- The Combo box now uses Atlas variables for its styling. This may change how the widget looks depending on the custom variables.
132136

133137
## [1.5.0] - 2024-05-06
134138

135139
### Added
136140

137-
- We added readonly style to the combobox configuration.
141+
- We added readonly style to the combobox configuration.
138142

139143
## [1.4.0] - 2024-04-19
140144

141145
### Changed
142146

143-
- We made accessibility text as optional.
147+
- We made accessibility text as optional.
144148

145-
- We are no longer retrieving full dropdown options list if the combobox is readonly.
149+
- We are no longer retrieving full dropdown options list if the combobox is readonly.
146150

147151
### Added
148152

149-
- We improved accessibility on combobox by removing a duplicated aria-expanded from combobox widget.
153+
- We improved accessibility on combobox by removing a duplicated aria-expanded from combobox widget.
150154

151155
### Fixed
152156

153-
- We fixed an issue with the sorting of the displayed selected items in Multi Selection, where the sorting of selected items did not match the sorting in the menu.
157+
- We fixed an issue with the sorting of the displayed selected items in Multi Selection, where the sorting of selected items did not match the sorting in the menu.
154158

155159
## [1.3.1] - 2024-04-08
156160

157161
### Fixed
158162

159-
- We fixed scrollbar click issue causing combobox to close.
163+
- We fixed scrollbar click issue causing combobox to close.
160164

161165
## [1.3.0] - 2024-04-03
162166

163167
### Fixed
164168

165-
- We fixed sorting on combobox, now the sorting follows the default when the combobox opens, and follow a sorted ranking when any input is given.
169+
- We fixed sorting on combobox, now the sorting follows the default when the combobox opens, and follow a sorted ranking when any input is given.
166170

167-
- We fixed focusable element not able to have focus if being placed on custom footer.
171+
- We fixed focusable element not able to have focus if being placed on custom footer.
168172

169173
### Added
170174

171-
- We added static values feature support.
175+
- We added static values feature support.
172176

173177
## [1.2.0] - 2024-02-27
174178

175179
### Fixed
176180

177-
- We fixed no options text not shown on single selection.
181+
- We fixed no options text not shown on single selection.
178182

179183
### Changed
180184

181-
- We made a minor change on the configuration labels.
185+
- We made a minor change on the configuration labels.
182186

183187
### Added
184188

185-
- We added database list feature support.
189+
- We added database list feature support.
186190

187191
## [1.1.3] - 2024-01-22
188192

189193
### Fixed
190194

191-
- We fixed dropdown options directly closing when clicking on scrollbar if placed in popup dialog
195+
- We fixed dropdown options directly closing when clicking on scrollbar if placed in popup dialog
192196

193197
## [1.1.2] - 2024-01-19
194198

195199
### Fixed
196200

197-
- We fixed selected options not showing for custom content type "yes"
201+
- We fixed selected options not showing for custom content type "yes"
198202

199203
## [1.1.1] - 2024-01-15
200204

201205
### Changed
202206

203-
- We changed **Select/Unselect button** caption into **Show Select all** for easier understanding
207+
- We changed **Select/Unselect button** caption into **Show Select all** for easier understanding
204208

205209
## [1.1.0] - 2024-01-14
206210

207211
### Added
208212

209-
- We added a new property named **Show footer**, enabling the Combobox widget to display a footer within its menu. When **Show footer** is set to **Yes**, developers can include custom footer content such as text, buttons, links, etc.
213+
- We added a new property named **Show footer**, enabling the Combobox widget to display a footer within its menu. When **Show footer** is set to **Yes**, developers can include custom footer content such as text, buttons, links, etc.
210214

211-
- We added a new property named **Select/Unselect button**, enabling the Combobox widget to display a select/unselect all button on the top of the menu list.
215+
- We added a new property named **Select/Unselect button**, enabling the Combobox widget to display a select/unselect all button on the top of the menu list.
212216

213217
### Fixed
214218

215-
- Sorting of the search results now follow the sort order set for Selectable objects.
219+
- Sorting of the search results now follow the sort order set for Selectable objects.
216220

217-
- We removed the clear button on selected item labels in read-only state.
221+
- We removed the clear button on selected item labels in read-only state.
218222

219-
- We fixed the positioning of the menu when it is flipped and collides with top of the viewport.
223+
- We fixed the positioning of the menu when it is flipped and collides with top of the viewport.
220224

221-
- We fixed single selection combo box losing focus after selecting an item.
225+
- We fixed single selection combo box losing focus after selecting an item.

packages/pluggableWidgets/combobox-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/combobox-web",
33
"widgetName": "Combobox",
4-
"version": "2.3.0",
4+
"version": "2.3.1",
55
"description": "Configurable Combo box widget with suggestions and autocomplete.",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/combobox-web/src/components/MultiSelection/MultiSelection.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export function MultiSelection({
163163
menuHeaderContent={
164164
selector.selectAllButton ? (
165165
<SelectAllButton
166+
disabled={items.length === 0}
166167
value={isOptionsSelected}
167168
id={`${options.inputId}-select-all-button`}
168169
ariaLabel={a11yConfig.ariaLabels.selectAll}

packages/pluggableWidgets/combobox-web/src/components/MultiSelection/SelectAllButton.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ import { CaptionContent } from "../../helpers/utils";
66

77
interface SelectAllButtonProps extends Partial<UseComboboxPropGetters<string>> {
88
id?: string;
9+
disabled?: boolean;
910
ariaLabel?: string;
1011
value: ThreeStateCheckBoxEnum;
1112
onChange?: () => void;
1213
}
1314

14-
export function SelectAllButton({ id, ariaLabel, value, onChange }: SelectAllButtonProps): ReactElement {
15+
export function SelectAllButton({ id, disabled, ariaLabel, value, onChange }: SelectAllButtonProps): ReactElement {
1516
return (
1617
<Fragment>
1718
<span
1819
className={classNames(
1920
"widget-combobox-menu-header-select-all-button",
20-
"widget-combobox-icon-container"
21+
"widget-combobox-icon-container",
22+
{
23+
"widget-combobox-menu-header-select-all-button-disabled": disabled
24+
}
2125
)}
2226
>
23-
<ThreeStateCheckBox value={value} id={id} onChange={onChange} />
27+
<ThreeStateCheckBox value={disabled ? "none" : value} id={id} onChange={onChange} disabled={disabled} />
2428
</span>
2529
{ariaLabel ? (
2630
// empty onclick function is being set to allow label clicking

packages/pluggableWidgets/combobox-web/src/package.xml

+1-1
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="Combobox" version="2.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Combobox" version="2.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Combobox.xml" />
66
</widgetFiles>

packages/pluggableWidgets/combobox-web/src/ui/Combobox.scss

+17-3
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,19 @@ $cb-skeleton-dark: #d2d2d2;
4545
}
4646
&-lazy-scroll {
4747
background:
48-
/* Shadow Cover TOP */ linear-gradient(white 30%, rgba(255, 255, 255, 0)) center
49-
top,
48+
/* Shadow Cover TOP */
49+
linear-gradient(white 30%, rgba(255, 255, 255, 0)) center top,
5050
/* Shadow Cover BOTTOM */ linear-gradient(rgba(255, 255, 255, 0), white 70%) center bottom,
5151
/* Shadow TOP */ linear-gradient(0deg, rgba(255, 255, 255, 0.6), rgba(197, 197, 197, 0.6)) center top,
5252
/* Shadow BOTTOM */ linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(197, 197, 197, 0.6)) center
5353
bottom;
5454

5555
background-repeat: no-repeat;
56-
background-size: 100% 70px, 100% 70px, 100% 35px, 100% 35px;
56+
background-size:
57+
100% 70px,
58+
100% 70px,
59+
100% 35px,
60+
100% 35px;
5761
background-attachment: local, local, scroll, scroll;
5862
}
5963
&-hidden {
@@ -73,6 +77,16 @@ $cb-skeleton-dark: #d2d2d2;
7377
content: "";
7478
border-color: var(--btn-default-bg-hover, $cb-hover-color);
7579
}
80+
81+
&-select-all-button {
82+
& + label {
83+
transition: color 0.2s ease-in-out;
84+
}
85+
86+
&-disabled + label {
87+
color: var(--color-default-dark, $cb-disabled-text-color);
88+
}
89+
}
7690
}
7791

7892
&-footer {

0 commit comments

Comments
 (0)