@skeletonlabs/skeleton 2.10.0-dev.7e8add8a → 2.10.0-dev.f74c8602

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.
@@ -59,9 +59,6 @@ onMount(() => {
59
59
  externalForm.removeEventListener("reset", resetFormHandler);
60
60
  };
61
61
  });
62
- function onInputHandler() {
63
- inputValid = true;
64
- }
65
62
  function validateCustom(chip) {
66
63
  return validation === void 0 || validation(chip);
67
64
  }
@@ -97,7 +94,9 @@ function removeChipCommon(chip) {
97
94
  chipValues.splice(chipIndex, 1);
98
95
  chipValues = chipValues;
99
96
  }
100
- function addChipInternally(event) {
97
+ function onKeyHandler(event) {
98
+ if (event.key !== "Enter")
99
+ return;
101
100
  event.preventDefault();
102
101
  inputValid = validate();
103
102
  if (inputValid === false) {
@@ -158,19 +157,17 @@ $:
158
157
  <!-- Chip Wrapper -->
159
158
  <div class="input-chip-wrapper {classesChipWrapper}">
160
159
  <!-- Input Field -->
161
- <form on:submit={addChipInternally}>
162
- <input
163
- type="text"
164
- bind:value={input}
165
- placeholder={$$restProps.placeholder ?? 'Enter values...'}
166
- class="input-chip-field {classesInput}"
167
- on:input={onInputHandler}
168
- on:input
169
- on:focus
170
- on:blur
171
- disabled={$$restProps.disabled}
172
- />
173
- </form>
160
+ <input
161
+ type="text"
162
+ bind:value={input}
163
+ placeholder={$$restProps.placeholder ?? 'Enter values...'}
164
+ class="input-chip-field {classesInput}"
165
+ on:keydown={onKeyHandler}
166
+ on:input
167
+ on:focus
168
+ on:blur
169
+ disabled={$$restProps.disabled}
170
+ />
174
171
  <!-- Chip List -->
175
172
  {#if chipValues.length}
176
173
  <div
@@ -76,7 +76,7 @@ declare class __sveltets_Render<ListTransitionIn extends Transition = FlyTransit
76
76
  keydown: KeyboardEvent;
77
77
  keyup: KeyboardEvent;
78
78
  add: CustomEvent<{
79
- event: SubmitEvent;
79
+ event: KeyboardEvent;
80
80
  chipIndex: number;
81
81
  chipValue: string;
82
82
  }>;
@@ -93,7 +93,7 @@ declare class __sveltets_Render<ListTransitionIn extends Transition = FlyTransit
93
93
  chipValue: string;
94
94
  }>;
95
95
  invalid: CustomEvent<{
96
- event: SubmitEvent;
96
+ event: KeyboardEvent;
97
97
  input: string;
98
98
  }>;
99
99
  invalidManually: CustomEvent<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "2.10.0-dev.7e8add8a",
3
+ "version": "2.10.0-dev.f74c8602",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {