diff --git a/lib/src/html_editor_controller_web.dart b/lib/src/html_editor_controller_web.dart
index 88e7f344..a2dcdac5 100644
--- a/lib/src/html_editor_controller_web.dart
+++ b/lib/src/html_editor_controller_web.dart
@@ -245,11 +245,7 @@ class HtmlEditorController extends unsupported.HtmlEditorController {
/// Recalculates the height of the editor to remove any vertical scrolling.
/// This method will not do anything if [autoAdjustHeight] is turned off.
@override
- void recalculateHeight() {
- _evaluateJavascriptWeb(data: {
- 'type': 'toIframe: getHeight',
- });
- }
+ void recalculateHeight() {}
/// A function to quickly call a document.execCommand function in a readable format
@override
diff --git a/lib/src/widgets/html_editor_widget_web.dart b/lib/src/widgets/html_editor_widget_web.dart
index dfc63215..b3ba636b 100644
--- a/lib/src/widgets/html_editor_widget_web.dart
+++ b/lib/src/widgets/html_editor_widget_web.dart
@@ -90,6 +90,12 @@ class _HtmlEditorWidgetWebState extends State {
var headString = '';
var summernoteCallbacks = '''callbacks: {
onKeydown: function(e) {
+ if (e.keyCode === 13) { /* ENTER */
+ const editor = querySelector('.note-editable');
+ editor.blur();
+ editor.focus();
+ }
+
var chars = \$(".note-editable").text();
var totalChars = chars.length;
${widget.htmlEditorOptions.characterLimit != null ? '''allowedKeys = (
@@ -277,10 +283,6 @@ class _HtmlEditorWidgetWebState extends State {
var str = \$('#summernote-2').summernote('code');
window.parent.postMessage(JSON.stringify({"type": "toDart: getTextWithSignatureContent", "text": str}), "*");
}
- if (data["type"].includes("getHeight")) {
- var height = document.body.scrollHeight;
- window.parent.postMessage(JSON.stringify({"view": "$createdViewId", "type": "toDart: htmlHeight", "height": height}), "*");
- }
if (data["type"].includes("setInputType")) {
document.getElementsByClassName('note-editable')[0].setAttribute('inputmode', '${widget.htmlEditorOptions.inputType.name}');
}
@@ -898,7 +900,7 @@ class _HtmlEditorWidgetWebState extends State {
widget.callbacks?.onInitialTextLoadComplete?.call(
widget.htmlEditorOptions.initialText!);
}
- var data = {'type': 'toIframe: getHeight'};
+ var data = {};
data['view'] = createdViewId;
var data2 = {'type': 'toIframe: setInputType'};
data2['view'] = createdViewId;