wip
This commit is contained in:
parent
4d79589903
commit
9ef34359d8
@ -166,16 +166,18 @@
|
||||
updateVisibleItems();
|
||||
}
|
||||
|
||||
// Initialize container size observer and autofocus
|
||||
onMount(() => {
|
||||
// Initialize container size observer and autofocus fallback
|
||||
onMount(async () => {
|
||||
if (container) {
|
||||
const resizeObserver = new ResizeObserver(updateVisibleCount);
|
||||
resizeObserver.observe(container);
|
||||
if (autofocus && inputElement) {
|
||||
inputElement.focus();
|
||||
}
|
||||
return () => resizeObserver.disconnect();
|
||||
}
|
||||
// Fallback autofocus with tick to ensure inputElement is bound
|
||||
if (autofocus && inputElement) {
|
||||
await tick();
|
||||
inputElement.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Get display text for the input
|
||||
@ -204,6 +206,7 @@
|
||||
class="w-full bg-transparent focus:outline-none {selected
|
||||
? 'text-black'
|
||||
: 'text-gray-700'}"
|
||||
{autofocus}
|
||||
on:focus={handleInputFocus}
|
||||
on:input={handleInput}
|
||||
on:keydown={(e) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user