svelte-headlessui icon indicating copy to clipboard operation
svelte-headlessui copied to clipboard

User specified `id` on combobox list item causes infinite loop

Open codewithcheese opened this issue 2 years ago • 1 comments
trafficstars

Hi, loving the concept and implementation of this library, being able to bring your own HTML and then adding actions to get the required functionality feels like a real solution for headless UI logic finally. Thank you!

I encountered an infinite state update loop due to an id being set on the combobox list item. Here's what I mean https://github.com/codewithcheese/svelte-headlessui/commit/d7ff662392875d6911eed524dd7d476cc79673f6

I was copying some HTML from tailwindui which had ids set. I see this breaks how the library uses ids internally, and I now know to remove them.

This was hard to debug and not a pleasant DX. If the goal is for users to bring actions to their own HTML then this could be a common pitfall. Not sure of the solution, maybe even just a warning would help

codewithcheese avatar Oct 28 '23 09:10 codewithcheese

It would probably make sense to just keep any existing ID if there was one.

CaptainCodeman avatar Nov 01 '23 17:11 CaptainCodeman