atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

feat(components): Autocomplete V2

Open scotttjob opened this issue 9 months ago • 6 comments

Motivations

  1. Needed a v2 automplete, along with the ability to trigger a 'setOptions' from the menu.

Changes

  1. Added support for v2 autocomplete, and the ability to trigger a 'setOptions' from the composed menu.

What to look out for

  1. updateOptions doesn't expect a string like getOptions does, it expects an arbitrary object which can contain just about anything. This allows a consumer to send specific requests up from the menu. This allows instructing a parent component to load a different list for instance to query the existing options against. Triggering 'updateOptions' is typically done in a header/footer within the Autocomplete.

Testing

  1. Everything should still work as-is with no changes across all apps.
  2. Adding version={2} to an Autocomplete should now not render a react-hook-form controller.
  3. There is a new updateOptions function prop that can be passed to Autocomplete which will be accessible via the menu.

Changes can be tested via Pre-release


In Atlantis we use Github's built in pull request reviews.

scotttjob avatar Jul 09 '25 12:07 scotttjob

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: dd5932b
Status: ✅  Deploy successful!
Preview URL: https://c1467b41.atlantis.pages.dev
Branch Preview URL: https://scott-t-autocomplete-2-updat.atlantis.pages.dev

View logs

Published Pre-release for 4f995b8d294a9bf50f7986c62e4e1db8f8d059fa with versions:

  - @jobber/[email protected]+4f995b8d

To install the new version(s) for Web run:

npm install @jobber/[email protected]+4f995b8d

github-actions[bot] avatar Jul 09 '25 12:07 github-actions[bot]

as an aside, the lines of code changed in this PR is really big. it's all coming from the package-lock where it looks like react-aria-components was added to site

it doesn't seem like we need that, right?

ZakaryH avatar Jul 09 '25 20:07 ZakaryH

if you change the standard options, it works as I'd expect. however if you change the group section names at all, it causes the menu to close. the values will have been replaced though.

Kapture 2025-07-09 at 14 22 30

ZakaryH avatar Jul 09 '25 21:07 ZakaryH

another couple scenarios that are behaving unexpectedly related to the above

if I keep the headers the same only swapping out the actual options, and I click the footer button (both footer buttons have the same onclick calling handleUpdateOptions) in Invoices, it also closes the menu Kapture 2025-07-09 at 14 24 52

then weridly, with that exact same data if I click the footer button in the Quotes section, it doesn't close 🤔 Kapture 2025-07-09 at 14 27 37

ZakaryH avatar Jul 09 '25 21:07 ZakaryH

as an aside, the lines of code changed in this PR is really big. it's all coming from the package-lock where it looks like react-aria-components was added to site

it doesn't seem like we need that, right?

Nope, I might just need to re-run the install. I accidentally added it in there at one point in my exploration and then removed it.

scotttjob avatar Jul 10 '25 15:07 scotttjob