noph-ui 0.16.8 → 0.16.9

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.
@@ -67,13 +67,10 @@
67
67
  return options.find((option) => option.value === value)?.label || ''
68
68
  })
69
69
  $effect(() => {
70
- if (
71
- value &&
72
- (Array.isArray(value) ? value.length !== 0 : value !== '') &&
73
- selectElement?.checkValidity()
74
- ) {
75
- errorRaw = error
76
- errorTextRaw = errorText
70
+ errorRaw = error
71
+ errorTextRaw = errorText
72
+ if (error && errorText !== '') {
73
+ selectElement?.setCustomValidity(errorText)
77
74
  }
78
75
  })
79
76
  $effect(() => {
@@ -207,6 +204,7 @@
207
204
  <select
208
205
  tabindex="-1"
209
206
  aria-label={attributes['aria-label'] || label}
207
+ aria-invalid={errorRaw}
210
208
  {disabled}
211
209
  {required}
212
210
  {name}
@@ -55,6 +55,9 @@
55
55
  $effect(() => {
56
56
  errorRaw = error
57
57
  errorTextRaw = errorText
58
+ if (error && errorText !== '') {
59
+ inputElement?.setCustomValidity(errorText)
60
+ }
58
61
  })
59
62
 
60
63
  $effect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.16.8",
3
+ "version": "0.16.9",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {