@placeholderco/placeholder-ui 3.0.0 → 3.0.1

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.
@@ -170,7 +170,14 @@
170
170
 
171
171
  function focus() {
172
172
  open = true;
173
- tick().then(() => textboxElement?.focus());
173
+ tick().then(focusTextbox);
174
+ }
175
+
176
+ // Select any leftover filter text on reopen so typing replaces it
177
+ function focusTextbox() {
178
+ const input = textboxElement as HTMLInputElement | undefined;
179
+ input?.focus();
180
+ input?.select();
174
181
  }
175
182
 
176
183
  $effect(() => {
@@ -319,7 +326,7 @@
319
326
  onclick={() => {
320
327
  open = !open;
321
328
  if (open && computedAllowSearch) {
322
- tick().then(() => textboxElement?.focus());
329
+ tick().then(focusTextbox);
323
330
  }
324
331
  }}
325
332
  onkeydown={(e) => onKeyDown(e)}
@@ -181,7 +181,14 @@
181
181
 
182
182
  function focus() {
183
183
  open = true;
184
- tick().then(() => textboxElement?.focus());
184
+ tick().then(focusTextbox);
185
+ }
186
+
187
+ // Select any leftover filter text on reopen so typing replaces it
188
+ function focusTextbox() {
189
+ const input = textboxElement as HTMLInputElement | undefined;
190
+ input?.focus();
191
+ input?.select();
185
192
  }
186
193
 
187
194
  $effect(() => {
@@ -294,7 +301,7 @@
294
301
  onclick={() => {
295
302
  open = !open;
296
303
  if (open && computedAllowSearch) {
297
- tick().then(() => textboxElement?.focus());
304
+ tick().then(focusTextbox);
298
305
  }
299
306
  }}
300
307
  onkeydown={(e) => onKeyDown(e)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@placeholderco/placeholder-ui",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "A modern, customizable Svelte 5 UI component library with comprehensive theming support. Re-brand it with a single config object.",
5
5
  "license": "MIT",
6
6
  "author": "Placeholderco",