Skip to content

Commit ab2e3fa

Browse files
committed
Fixed a bug where selected tab changes randomly
1 parent bb5a49f commit ab2e3fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/editor.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ class _EditorPageState extends State<EditorPage> {
310310
// Populate the file browser tree once
311311
initializeTreeView();
312312
}
313+
var tabController = TabbedViewController(tabs,);
314+
tabController.selectedIndex = selectedTab;
313315
final page = Stack(children: [
314316
Column(//direction: Axis.vertical,
315317
children: [
@@ -326,7 +328,7 @@ class _EditorPageState extends State<EditorPage> {
326328
/// Just refresh the state
327329
});
328330
},
329-
controller: TabbedViewController(tabs),
331+
controller: tabController,
330332
))
331333
: const Center(child: Text("No file opened")),
332334
),

0 commit comments

Comments
 (0)