noph-ui 0.21.13 → 0.21.15

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.
@@ -46,6 +46,9 @@
46
46
  </style>
47
47
  </svelte:head>
48
48
 
49
- <span {...attributes} class={['np-icon', 'notranslate', attributes.class]} bind:this={element}
50
- >{@render children()}</span
49
+ <span
50
+ aria-hidden="true"
51
+ {...attributes}
52
+ class={['np-icon', 'notranslate', attributes.class]}
53
+ bind:this={element}>{@render children()}</span
51
54
  >
@@ -113,6 +113,8 @@
113
113
  if (checkValidity()) {
114
114
  errorRaw = error
115
115
  errorTextRaw = errorText
116
+ } else {
117
+ focusOnInvalid = true
116
118
  }
117
119
  } else {
118
120
  focusOnInvalid = true
@@ -1,2 +1 @@
1
1
  export declare const isFirstInvalidControlInForm: (form: HTMLFormElement | null, control: HTMLElement) => boolean;
2
- export declare const getFirstInvalidControlInForm: (form: HTMLFormElement) => Element | undefined;
@@ -2,15 +2,5 @@ export const isFirstInvalidControlInForm = (form, control) => {
2
2
  if (!form) {
3
3
  return true;
4
4
  }
5
- return getFirstInvalidControlInForm(form) === control;
6
- };
7
- export const getFirstInvalidControlInForm = (form) => {
8
- let firstInvalidControl;
9
- for (const element of form.elements) {
10
- if (element.matches(':invalid')) {
11
- firstInvalidControl = element;
12
- break;
13
- }
14
- }
15
- return firstInvalidControl;
5
+ return form.querySelector(':invalid') === control;
16
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.21.13",
3
+ "version": "0.21.15",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {