@carbon/vue 2.24.0 → 2.24.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/vue",
3
3
  "description": "A collection of components for the Carbon Design System built using Vue.js",
4
- "version": "2.24.0",
4
+ "version": "2.24.1",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -73,5 +73,5 @@
73
73
  "eslint-plugin-prettier": "^3.1.1",
74
74
  "vue-template-compiler": "^2.6.10"
75
75
  },
76
- "gitHead": "59349574a4f6b75a1236d4e4ddff6836433067db"
76
+ "gitHead": "159c58ddca4d549963f2c221763f4e24c76ecca4"
77
77
  }
@@ -22,9 +22,9 @@
22
22
  :class="{ 'bx--dropdown__wrapper--inline': inline, 'cv-dropdown': !formItem }"
23
23
  :style="wrapperStyleOverride"
24
24
  >
25
- <span v-if="label" :id="`${uid}-label`" class="bx--label" :class="{ 'bx--label--disabled': disabled }">{{
26
- label
27
- }}</span>
25
+ <span v-if="label" :id="`${uid}-label`" class="bx--label" :class="{ 'bx--label--disabled': disabled }">
26
+ {{ label }}
27
+ </span>
28
28
 
29
29
  <div
30
30
  v-if="!inline && isHelper"
@@ -65,7 +65,12 @@
65
65
  type="button"
66
66
  >
67
67
  <WarningFilled16 v-if="isInvalid && inline" class="bx--dropdown__invalid-icon" />
68
- <span class="bx--dropdown-text__inner" :id="`${uid}-value`">{{ internalCaption }}</span>
68
+ <span
69
+ class="bx--dropdown-text__inner"
70
+ :id="`${uid}-value`"
71
+ data-test="internalCaption"
72
+ v-html="internalCaption"
73
+ />
69
74
  <span class="bx--dropdown__arrow-container">
70
75
  <span class="bx--dropdown__arrow" :style="chevronStyleOveride">
71
76
  <chevron-down-glyph />
@@ -79,6 +84,7 @@
79
84
  :aria-hidden="!open"
80
85
  wh-menu-anchor="left"
81
86
  :aria-labelledby="`${uid}-label`"
87
+ ref="droplist"
82
88
  >
83
89
  <slot></slot>
84
90
  </ul>
@@ -281,8 +287,13 @@ export default {
281
287
  this.$el.focus();
282
288
  }
283
289
 
284
- if (ev.target.classList.contains('bx--dropdown-link')) {
285
- const targetItemEl = ev.target.parentNode;
290
+ let target = ev.target;
291
+ while (!target.classList.contains('bx--dropdown-link') && this.$refs.droplist.contains(target)) {
292
+ target = target.parentNode; // try next one up
293
+ }
294
+
295
+ if (target.classList.contains('bx--dropdown-link')) {
296
+ const targetItemEl = target.parentNode;
286
297
  const newValue = targetItemEl.getAttribute('data-value');
287
298
 
288
299
  this.internalValue = newValue;