mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: #918 could not update the link sometimes
This commit is contained in:
parent
01328442a0
commit
3686351592
@ -42,7 +42,7 @@ class FlowyRichText extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
|
||||
final _textKey = GlobalKey();
|
||||
var _textKey = GlobalKey();
|
||||
final _placeholderTextKey = GlobalKey();
|
||||
|
||||
final _lineHeight = 1.5;
|
||||
@ -53,6 +53,17 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
|
||||
RenderParagraph get _placeholderRenderParagraph =>
|
||||
_placeholderTextKey.currentContext?.findRenderObject() as RenderParagraph;
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant FlowyRichText oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
// https://github.com/flutter/flutter/issues/110342
|
||||
if (_textKey.currentWidget is RichText) {
|
||||
// Force refresh the RichText widget.
|
||||
_textKey = GlobalKey();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _buildRichText(context);
|
||||
|
@ -10,8 +10,8 @@ void main() async {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
});
|
||||
|
||||
group('delete_text_handler.dart', () {
|
||||
testWidgets('Presses backspace key in empty document', (tester) async {
|
||||
group('checkbox_text_handler.dart', () {
|
||||
testWidgets('Click checkbox icon', (tester) async {
|
||||
// Before
|
||||
//
|
||||
// [BIUS]Welcome to Appflowy 😁[BIUS]
|
||||
|
Loading…
Reference in New Issue
Block a user