@policystudio/policy-studio-ui-vue 1.2.0-access.75 → 1.2.0-access.76

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.2.0-access.75",
3
+ "version": "1.2.0-access.76",
4
4
  "description": "Policy Studio UI",
5
5
  "author": "Policy Studio Team",
6
6
  "scripts": {
@@ -4,6 +4,7 @@
4
4
  ref="PSDropdownTrigger"
5
5
  @click="toggle"
6
6
  @keydown.enter.stop.prevent="toggle"
7
+ @keydown.space.stop.prevent="toggle"
7
8
  >
8
9
  <slot
9
10
  v-if="hasDropdownTrigger"
@@ -159,9 +160,10 @@ const moveFocus = (offset) => {
159
160
  focusable[nextIndex].focus()
160
161
  }
161
162
 
162
- const open = () => {
163
+ const open = async () => {
163
164
  show.value = true
164
165
  emit('open')
166
+ await focusFirstElement()
165
167
  }
166
168
 
167
169
  const close = (event) => {
@@ -176,14 +178,12 @@ const toggle = async (event) => {
176
178
 
177
179
  if (event) event.stopPropagation()
178
180
 
179
- show.value = !show.value
180
-
181
- if (show.value) {
182
- await focusFirstElement()
181
+ if (!show.value) {
182
+ await open()
183
183
  } else {
184
- emit('close')
184
+ close()
185
185
  }
186
186
  }
187
187
 
188
- defineExpose({ open, close })
188
+ defineExpose({ open, close, toggle })
189
189
  </script>