Fix Positioner rendering, Autocomplete + Combobox positioning issues #1362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes #1354 Combobox position issue
Fixes #1329 Autocomplete 'children' function continuously invoked
The root issue for #1329 was not the ref updates but the
useEffect
insrc/positioner/src/Positioner.js
. It was watchingdimensions
as a dependency while it was usingpreviousDimensions
and also callingupdate
, which wasn't wrapped in auseCallback
. This should only re-render when those values change. Tested out in storybook using the same console log in the children function as described in #1329Screenshots (if applicable)
Autocomplete rendering before
Positioner
changehttps://www.loom.com/share/353e9a69b7f744d2816bcdab7aff8dda
Autocomplete rendering after
Positioner
changehttps://www.loom.com/share/6f9963d7966046fdbd579ea2e3565a35
Note that both of these are after the
ref
changes inAutocomplete
andCombobox
were reverted, so those are appearing in the correct location.Combobox positioning (also demoable from Storybook)

Autocomplete positioning (also demoable from Storybook)

Documentation