nsw-design-system 3.11.1 → 3.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/main.js CHANGED
@@ -1364,9 +1364,10 @@
1364
1364
  } else if (count > 1) {
1365
1365
  label = `${count} ${this.textSelected}`;
1366
1366
  ariaLabel = `${count} ${this.textSelected}, Please select`;
1367
- } else if (count > 0) {
1368
- ariaLabel += `${this.options[0].text}, Please select`;
1369
- label = this.getSelectedOption().closest('.nsw-multi-select__option').dataset.label;
1367
+ } else if (count === 1) {
1368
+ const selectedOption = this.getSelectedOption();
1369
+ label = selectedOption.closest('.nsw-multi-select__option').getAttribute('data-label');
1370
+ ariaLabel = `${label}, Please select`;
1370
1371
  } else {
1371
1372
  label = noSelectionText;
1372
1373
  ariaLabel = 'Please select';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsw-design-system",
3
- "version": "3.11.1",
3
+ "version": "3.11.2",
4
4
  "description": "Design system for Digital NSW",
5
5
  "main": "dist/main.js",
6
6
  "style": "dist/main.css",
@@ -252,9 +252,10 @@ class Select {
252
252
  } else if (count > 1) {
253
253
  label = `${count} ${this.textSelected}`
254
254
  ariaLabel = `${count} ${this.textSelected}, Please select`
255
- } else if (count > 0) {
256
- ariaLabel += `${this.options[0].text}, Please select`
257
- label = this.getSelectedOption().closest('.nsw-multi-select__option').dataset.label
255
+ } else if (count === 1) {
256
+ const selectedOption = this.getSelectedOption()
257
+ label = selectedOption.closest('.nsw-multi-select__option').getAttribute('data-label')
258
+ ariaLabel = `${label}, Please select`
258
259
  } else {
259
260
  label = noSelectionText
260
261
  ariaLabel = 'Please select'