@windward/games 0.26.0 → 0.27.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## Release [0.27.0] - 2026-01-27
4
+
5
+ * Merged in bugfix/LE-2232-flashcards-when-the-prev-or-next (pull request #274)
6
+
7
+
3
8
  ## Release [0.26.0] - 2026-01-20
4
9
 
5
10
  * Merged in LE-2037-word-jumble-remove-feedback-se (pull request #278)
@@ -10,6 +10,7 @@
10
10
  outlined
11
11
  :class="cardClass"
12
12
  style="height: 90%"
13
+ tabindex="0"
13
14
  @keyup.enter="toggleCard"
14
15
  @click="toggleCard"
15
16
  >
@@ -27,6 +28,7 @@
27
28
  outlined
28
29
  :class="cardClass"
29
30
  style="height: 90%"
31
+ tabindex="0"
30
32
  @keyup.enter="toggleCard"
31
33
  @click="toggleCard"
32
34
  >
@@ -127,6 +129,17 @@ export default {
127
129
  target.$el.focus()
128
130
  })
129
131
  },
132
+ focusCard() {
133
+ // Focus the currently visible side of the card.
134
+ // Should always be front but just in case, check both refs
135
+ const ref = this.side ? this.$refs.cardFront : this.$refs.cardBack
136
+ if (!ref) return
137
+ // Vuetify components expose $el; native element does not
138
+ const el = ref.$el ? ref.$el : ref
139
+ if (el && typeof el.focus === 'function') {
140
+ el.focus()
141
+ }
142
+ },
130
143
  },
131
144
  }
132
145
  </script>
@@ -59,6 +59,7 @@
59
59
  :style="setBackgroundInCaseHighlight()"
60
60
  >
61
61
  <Flashcard
62
+ ref="flashcard"
62
63
  :options="card"
63
64
  :slide="currentSlide"
64
65
  :key="seed + '-' + currentSlide"
@@ -145,7 +146,31 @@ export default {
145
146
  }
146
147
  },
147
148
  },
149
+ watch: {
150
+ currentSlide() {
151
+ this.focusCurrentFlashcard()
152
+ },
153
+ },
148
154
  methods: {
155
+ focusCurrentFlashcard() {
156
+ // nexttick wasn't working here for refs on v-carousel
157
+ // setting hard wait time for slide to load
158
+ setTimeout(() => {
159
+ const refs = this.$refs.flashcard
160
+ // Refs not ready yet
161
+ if (!refs) {
162
+ return
163
+ }
164
+ const slideNumber = this.currentSlide || 0
165
+
166
+ // Access refs directly - don't try to convert to array
167
+ const current = refs[slideNumber]
168
+
169
+ if (current && typeof current.focusCard === 'function') {
170
+ current.focusCard()
171
+ }
172
+ }, 500)
173
+ },
149
174
  onActionPanelEdit() {
150
175
  this.render = !this.render
151
176
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/games",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Windward UI Plugin Games",
5
5
  "main": "plugin.js",
6
6
  "scripts": {