Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/react/src/SelectPanel/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,23 @@ function Panel({
}
}, [inputRef, open])

// Manage loading announcements when loadingManagedExternally
useEffect(() => {
if (loadingManagedExternally) {
if (isLoading) {
// Delay the announcement a bit, just in case the loading is quick
loadingDelayTimeoutId.current = safeSetTimeout(() => {
announceLoading()
}, LONG_DELAY_MS)
} else {
// If loading is done, we can clear the loading announcement
if (loadingDelayTimeoutId.current) {
safeClearTimeout(loadingDelayTimeoutId.current)
}
}
}
}, [isLoading, loadingManagedExternally, safeSetTimeout, safeClearTimeout])

// Populate panel with items on first open
useEffect(() => {
if (loadingManagedExternally) return
Expand Down
Loading