solidjs-community / solid-aria

A library of high-quality primitives that help you build accessible user interfaces with SolidJS.
Other
289 stars 16 forks source link

WIP Fix: list section children are not dynamic #62

Closed thetarnav closed 2 years ago

thetarnav commented 2 years ago

Fixes #59

TODO:

changeset-bot[bot] commented 2 years ago

⚠️ No Changeset found

Latest commit: a804a4ce979c3e9646d4076e86e9e980ec460385

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

thetarnav commented 2 years ago

Having the children dynamic required only small changes in two places:

  1. createCollection
  2. createListState

Accessing children just needed to be read under a tracking scope. The problem was that calling resolvedChildren wasn't tracking nested changes. e.g. if you would add another section it would probably track, but not if you add a new item under that section. Maybe a different primitive would be useful here? Like custom children() helper that will listen to nested changes too.

Here I just added path aliasing for vite, so that you don't have to rebuild after changing stuff in other deps.

As for the select and the failing tests, the createSelect isn't handling that initial focus after opening the options list properly it seems. Do you want to merge it to some wip branch and take it from here? I don't really know what to do more.

fabien-ml commented 2 years ago

You can merge into develop, will take a look at it when I have time.