Rebuild editor when keyboard is already open (#111)
* Rebuild editor when keyboard is already open If the keyboard is already open, but the editor thinks that the keyboard is not open, the text will not be updated when writing. This can easily happen if one has a `TabBarView` with two children, each with an `QuillEditor`, see the code for an example: <details><summary>Example</summary> ```dart import 'package:flutter/material.dart'; import 'package:flutter_quill/widgets/controller.dart'; import 'package:flutter_quill/widgets/editor.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { late QuillController _controller1; late QuillController _controller2; @override void initState() { _controller1 = QuillController.basic(); _controller2 = QuillController.basic(); super.initState(); } @override Widget build(BuildContext context) { return MaterialApp( home: DefaultTabController( length: 2, child: Scaffold( appBar: AppBar( title: Text('Flutter Quill tabs demo'), bottom: TabBar( tabs: [ Tab(text: 'First'), Tab(text: 'Second'), ], ), ), body: TabBarView( children: [ QuillEditor.basic(controller: _controller1, readOnly: false), QuillEditor.basic(controller: _controller2, readOnly: false), ], ), ), ), ); } } </details> <details><summary>Video</summary> </details> * Add documentation comment for getOffsetToRevealCursor * Set initial keyboard visibilitypull/116/head^2
parent
ace4fd4deb
commit
1cf37c1824
2 changed files with 6 additions and 0 deletions
Loading…
Reference in new issue