fix: hero not being focused
This commit is contained in:
@@ -543,6 +543,7 @@ class _DiscoverScreenState extends State<DiscoverScreen>
|
||||
if (!_isAutoScrollPaused) {
|
||||
_startAutoScroll();
|
||||
}
|
||||
_focusTopBoundary();
|
||||
}
|
||||
|
||||
// Helper method to calculate visible dot range (max 5 dots)
|
||||
|
||||
@@ -522,6 +522,14 @@ class _MainScreenState extends State<MainScreen> with RouteAware, WindowListener
|
||||
void _focusContent() {
|
||||
setState(() => _isSidebarFocused = false);
|
||||
_contentFocusScope.requestFocus();
|
||||
// When content regains focus while on Discover, focus the hero section
|
||||
if (_currentIndex == 0 && !_isOffline) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (_discoverKey.currentState case final TabVisibilityAware aware) {
|
||||
aware.onTabShown();
|
||||
}
|
||||
});
|
||||
}
|
||||
// When content regains focus while on Libraries, retry focusing the active tab
|
||||
if (_currentIndex == 1 && !_isOffline) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
|
||||
Reference in New Issue
Block a user