rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

Fix input focus issue in Select component #644

Closed 524c closed 7 months ago

524c commented 7 months ago

Fixes a crash when trying to read a property of an undefined value.

Select.svelte:457 Uncaught TypeError: Cannot read properties of undefined (reading 'focus')
    at HTMLInputElement.handleFocus (Select.svelte:457:15)
    at onScanElements (focusTrap.js:31:27)
    at focusTrap (focusTrap.js:37:5)
    at Object.mount [as m] (Modal.svelte:145:40)
    at Object.mount [as m] (Modal.svelte:137:19)
    at Object.update [as p] (Modal.svelte:136:28)
    at update (scheduler.js:119:30)
    at flush (scheduler.js:79:5)
handleFocus @ Select.svelte:457
onScanElements @ focusTrap.js:31
focusTrap @ focusTrap.js:37
mount @ Modal.svelte:145
mount @ Modal.svelte:137
update @ Modal.svelte:136
update @ scheduler.js:119
flush @ scheduler.js:79
Promise.then (async)
schedule_update @ scheduler.js:20
make_dirty @ Component.js:81
(anonymous) @ Component.js:139
(anonymous) @ Modal.svelte:46
set @ index.js:56
update @ index.js:69
trigger @ stores.js:41
(anonymous) @ +page.svelte:160
handleModal @ +page.svelte:149
click_handler_1 @ +page.svelte:417
vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-select ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2023 0:39am