[Web] Impossible to make an empty line #621
-
I'm having a weird issue in my editor, if I press Enter multiple times, it will only change line but will not put more (empty) lines. I can't reproduce this in the example, that's why I didn't open an issue for that. But I'm trying to figure out what could impact the editor rendering in such a way. I output the changes and document json and the multiple carriage return are there but not displayed in the editor. Document delta: [{"insert":"a\n\n\n\n\nb\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nc\n"}] I'm using Flutter 2.8.1, with the latest Flutter Quill 3.8.3, running on Chrome. Here's my widget editor build: Widget build(BuildContext context) {
// ... Variables initialization
return Positioned(
left: position.dx,
top: position.dy,
child: ClipRect(
child: GestureDetector(
onPanDown: (_) => null, // Prevent document drag in editor zone
onDoubleTap: () => null, // Prevent document zoom in editor zone
child: SizedBox(
width: annotationBoundaries.width,
height: annotationBoundaries.height,
child: RepaintBoundary(
child: QuillEditor(
controller: _editor.quillController,
scrollController: _scrollController,
maxHeight: annotationBoundaries.height,
scrollable: true,
focusNode: _focusNode,
autoFocus: true,
readOnly: false,
expands: false,
customStyles: theme.textAnnotationTheme.editorStyles,
padding: TextAnnotationTheme.PADDING,
enableInteractiveSelection: true,
),
),
),
),
),
);
} In case you're wondering why the |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 12 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I've managed to get a somewhat functional modification but it's not perfect. I adapted @HUA616436641's proposition and put it in the |
Beta Was this translation helpful? Give feedback.
-
I run the example in the latest version with flutter 2.10,and it work fine,did you do any change to the source code? flutter-quill 4.0.2 |
Beta Was this translation helpful? Give feedback.
-
I figured out why I have a different behavior on this, and other things, vs the example app: the rendering mode. I my project, we forced html rendering over canvaskit. We did recent developements and had to enable canvaskit instead and surprise: everything is back to normal! So if I force html rendering (adding --web-renderer html argument), I can reproduce the problem in the example. So the fix is to force canvaskit. |
Beta Was this translation helpful? Give feedback.
-
@xinyuezhang0402 Actually, there is no need for a PR as both html and canvaskit are supported rendering mode for flutter web. A fix for the html rendering would still be required, ideally, but personally I have no idea how to fix that. |
Beta Was this translation helpful? Give feedback.
-
@NicolasDionB,could you please kindly check if CTRL+F and search works on the editor content if you force canvasKit rendering? |
Beta Was this translation helpful? Give feedback.
I figured out why I have a different behavior on this, and other things, vs the example app: the rendering mode. I my project, we forced html rendering over canvaskit. We did recent developements and had to enable canvaskit instead and surprise: everything is back to normal!
So if I force html rendering (adding --web-renderer html argument), I can reproduce the problem in the example. So the fix is to force canvaskit.