Skip to content

Commit

Permalink
Fixed changing tabs when widget dialog is open
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Nov 3, 2023
1 parent 7811da1 commit 064cd46
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/pages/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
tabViews: grids,
),
AddWidgetDialog(
grid: grids[currentTabIndex],
grid: () => grids[currentTabIndex],
visible: addWidgetDialogVisible,
onNT4DragUpdate: (globalPosition, widget) {
grids[currentTabIndex]
Expand Down Expand Up @@ -1002,7 +1002,7 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
}

class AddWidgetDialog extends StatelessWidget {
final DashboardGrid grid;
final DashboardGrid Function() grid;
final bool visible;

final Function(Offset globalPosition, DraggableNT4WidgetContainer widget)?
Expand Down Expand Up @@ -1063,13 +1063,14 @@ class AddWidgetDialog extends StatelessWidget {
NetworkTableTree(
onDragUpdate: onNT4DragUpdate,
onDragEnd: onNT4DragEnd,
widgetContainerBuilder: grid.createNT4WidgetContainer,
widgetContainerBuilder: (widgetContainer) =>
grid().createNT4WidgetContainer(widgetContainer),
),
ListView(
children: [
LayoutDragTile(
title: 'List Layout',
layoutBuilder: () => grid.createListLayout(),
layoutBuilder: () => grid().createListLayout(),
onDragUpdate: onLayoutDragUpdate,
onDragEnd: onLayoutDragEnd,
),
Expand Down

0 comments on commit 064cd46

Please sign in to comment.