@sbc-connect/nuxt-base 0.13.1 → 0.13.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sbc-connect/nuxt-base
|
|
2
2
|
|
|
3
|
+
## 0.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#190](https://github.com/bcgov/connect-nuxt/pull/190) [`4a4846b`](https://github.com/bcgov/connect-nuxt/commit/4a4846b53acb28b5a77cca8f9fb67393ba0132f9) Thanks [@eve-git](https://github.com/eve-git)! - Fix Tab order in Safari skipping the date picker calendar's month/year navigation buttons, and report date input changes to form validation as the user types instead of only on blur
|
|
8
|
+
|
|
3
9
|
## 0.13.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -26,11 +26,11 @@ const props = defineProps<{
|
|
|
26
26
|
const { locale } = useI18n()
|
|
27
27
|
|
|
28
28
|
// wires the input up to the wrapping UFormField (if any): aria-describedby/
|
|
29
|
-
// aria-invalid derived from its help/error text, and blur reported onto
|
|
30
|
-
// form's validation bus. Calling this here (rather than leaving it to the
|
|
29
|
+
// aria-invalid derived from its help/error text, and blur/input reported onto
|
|
30
|
+
// the form's validation bus. Calling this here (rather than leaving it to the
|
|
31
31
|
// inner UInput) makes the relationship explicit and independent of UInput's
|
|
32
32
|
// own internal wiring.
|
|
33
|
-
const { ariaAttrs, emitFormBlur } = useFormField()
|
|
33
|
+
const { ariaAttrs, emitFormBlur, emitFormInput } = useFormField()
|
|
34
34
|
|
|
35
35
|
const dateModel = defineModel<string>()
|
|
36
36
|
|
|
@@ -154,7 +154,20 @@ function onDateSelect(date: DateValue | DateRange | DateValue[] | null | undefin
|
|
|
154
154
|
})
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
// Reka UI's Calendar.Prev/Calendar.Next header buttons render as plain
|
|
158
|
+
// <button>s with no tabindex, same as the trailing icon buttons above -
|
|
159
|
+
// Safari excludes them from Tab order by default, so without this, Tab skips
|
|
160
|
+
// straight past prev-month/next-month/next-year into the day grid
|
|
161
|
+
function fixHeaderButtonTabOrder() {
|
|
162
|
+
nextTick(() => {
|
|
163
|
+
calendarContentRef.value
|
|
164
|
+
?.querySelectorAll<HTMLElement>('[data-slot="header"] button')
|
|
165
|
+
.forEach(button => button.setAttribute('tabindex', '0'))
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
|
|
157
169
|
function onOpenAutoFocus(e: Event) {
|
|
170
|
+
fixHeaderButtonTabOrder()
|
|
158
171
|
if (calendarOpenedViaInput) {
|
|
159
172
|
e.preventDefault()
|
|
160
173
|
calendarOpenedViaInput = false
|
|
@@ -233,6 +246,10 @@ watch(dateInput, (val: string) => {
|
|
|
233
246
|
// sync immediately so the parent (and its schema validation) always sees the
|
|
234
247
|
// current value instead of waiting for the debounced auto-formatting below
|
|
235
248
|
syncModelFromLocal()
|
|
249
|
+
// report the change onto the form's validation bus as it's typed, rather than
|
|
250
|
+
// only on blur - emitFormInput() is always eager here (see useFormField), so
|
|
251
|
+
// this revalidates on every keystroke instead of waiting for a first blur
|
|
252
|
+
emitFormInput()
|
|
236
253
|
|
|
237
254
|
clearTimeout(debounceTimer)
|
|
238
255
|
if (!val) {
|