Skip to content

Commit 01871b3

Browse files
authored
Merge pull request #780 from synapsecode/minor_bugfix/body_json_editor
Fixes Rare '<optimized out>' Exception when changing Body Content-Type back to json
2 parents 7686aee + a90fff0 commit 01871b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/widgets/editor_json.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ class _JsonTextFieldEditorState extends State<JsonTextFieldEditor> {
5151
if (widget.initialValue != null) {
5252
controller.text = widget.initialValue!;
5353
}
54-
controller.formatJson(sortJson: false);
54+
Future.delayed(Duration(milliseconds: 50), () {
55+
controller.formatJson(sortJson: false);
56+
setState(() {});
57+
});
5558
editorFocusNode = FocusNode(debugLabel: "Editor Focus Node");
5659
}
5760

0 commit comments

Comments
 (0)