Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Bring back async tether scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
vovakulikov committed Oct 18, 2022
1 parent 41e8b9e commit d068b76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/wildcard/src/components/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ export const ComboboxOption = forwardRef((props, ref) => {
// Schedule scroll into view in the next frame in order to wait for possible
// on going positioning work in the ComboboxPopover component.
requestAnimationFrame(() => {
scrollIntoView({ view: listElement, element: optionElement, center: true })
requestAnimationFrame(() => {
scrollIntoView({ view: listElement, element: optionElement, center: true })
})
})
}
}, [listRef, mergedRef])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function createTether(tether: Tether): TetherInstanceAPI {
document.addEventListener('input', eventHandler, true)

// Synthetic runs without target for the initial tooltip positioning render
render(tether, null)
requestAnimationFrame(() => render(tether, null))

return {
unsubscribe: () => {
Expand Down

0 comments on commit d068b76

Please sign in to comment.