Closed balinterdi closed 2 years ago
Somethings not quite right here.
I should be able to hit enter to select the first item in the list.
Compare this implementation compared to react.
I should be able to hit enter to select the first item in the list.
Indeed, that's not covered by tests, I'll take a look.
@dmcnamara-eng I think I fixed it now!
Hi, all! Thanks for implementing the combobox! I'd really like to try it out but I still didn't figure out how to install ember-headlessui from this branch. Got any tips?
@rreckonerr The challenge with using a branch (custom SHA) of a forked monorepo is that the top-level folder of the github repository is not the same as the package's folder. Here, the package lives under /ember-headlessui
in the repo.
The solution I've found is to use a service called gitpkg that allows to "link" to a subfolder in the dependency string.
Here is what we use as the dependency for ember-headlessui
in our package.json:
That SHA at the end might change but you get the point. (You can even create a fork in your repo to have more control over the version you use).
@balinterdi Thanks for the quick response! Do you also use pnpm for that? I think I hit this issue when I tried to install it from the gitpkg the last time
No, in this project we use yarn although I don't see why it should matter – I think it's just standard package.json
syntax.
This project uses pnpm.
Yarn is riddled with hoisting bugs in monorepos.
The best way to test this package, pre-release, is to clone locally and link (npm/yarn/pnpm).
It went to a monorepo format for incrementally moving to a v2 addon, which presently requires a monorepo (until bottled-ember work progresses). I got hung up on a bunch of weird things working in auno-import via node shims that shouldn't be in the browser ever, and i stepped away for a while:( Apologies for the inprogress migration
@NullVoxPopuli Thank you for explaining.
I meant that the host project that uses this fork of ember-headlessui uses yarn.
I first tried to yarn link it locally to test but it didn't seem to work at all – the ember-headlessui component files didn't make it into the build of the host app. After trying in vain for half a day, I found gitpkg and it worked on the first try.
Thanks for updating this @balinterdi
Seems to be API complete at this point and robust enough to merge. 👍 ⭐ 💥
Co-authored-by: David McNamara david.mcnamara@phorest.com
The original implementation by done by David but the file structure of the add-on has been drastically changed so the feasible way was to copy his work from the previous place.
Also, Ember seems to have gotten way stricter about throwing the "You attempted to update activeOptionIndex but it'd already been used previously in the same computation" errors so a lot of the pieces needed to be refactored to make tests pass.