Skip to content

Commit

Permalink
Remove FocusNode unnecessary
Browse files Browse the repository at this point in the history
Signed-off-by: dab246 <[email protected]>
  • Loading branch information
dab246 committed Sep 30, 2024
1 parent 158e2b7 commit 60c4b31
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/src/widgets/html_editor_widget_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
StreamSubscription<html.MessageEvent>? _editorJSListener;
StreamSubscription<html.MessageEvent>? _summernoteOnLoadListener;
static const String _summernoteLoadedMessage = '_HtmlEditorWidgetWebState::summernoteLoaded';
final _focusNode = FocusNode();

@override
void initState() {
Expand Down Expand Up @@ -675,9 +674,7 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
),
);

return Focus(
focusNode: _focusNode,
child: child);
return child;
}

/// Adds the callbacks the user set into JavaScript
Expand Down Expand Up @@ -815,7 +812,6 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
c.onEnter!.call();
}
if (data['type'].contains('onFocus')) {
_focusNode.requestFocus();
c.onFocus!.call();
}
if (data['type'].contains('onUnFocus')) {
Expand Down Expand Up @@ -995,7 +991,6 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
void dispose() {
_editorJSListener?.cancel();
_summernoteOnLoadListener?.cancel();
_focusNode.dispose();
super.dispose();
}
}

0 comments on commit 60c4b31

Please sign in to comment.