From e954b3a6482027761facea9b56694ccb5946259b Mon Sep 17 00:00:00 2001 From: li3317 Date: Thu, 25 Nov 2021 15:01:14 -0500 Subject: [PATCH 1/2] handle click on embed object --- lib/src/translations/toolbar.i18n.dart | 5 +++-- lib/src/widgets/text_line.dart | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/src/translations/toolbar.i18n.dart b/lib/src/translations/toolbar.i18n.dart index 353b6c27..d8eba561 100644 --- a/lib/src/translations/toolbar.i18n.dart +++ b/lib/src/translations/toolbar.i18n.dart @@ -74,14 +74,15 @@ extension Localization on String { 'Gallery': 'Galeria', 'Link': 'Enlace', 'Please first select some text to transform into a link.': - 'Por favor selecciona primero un texto para transformarlo en un enlace', + 'Por favor selecciona primero un texto para transformarlo ' + 'en un enlace', }, 'tr': { 'Paste a link': 'Bağlantıyı Yapıştır', 'Ok': 'Tamam', 'Select Color': 'Renk Seçin', 'Gallery': 'Galeri', - 'Link': 'Bağlantı', + 'Link': 'Bağlantı', 'Please first select some text to transform into a link.': 'Lütfen bağlantıya dönüştürmek için bir metin seçin.', }, diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index e9e5f229..0990e797 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -876,7 +876,14 @@ class RenderEditableTextLine extends RenderEditableBox { @override bool hitTestChildren(BoxHitTestResult result, {required Offset position}) { - return _children.first.hitTest(result, position: position); + if (_body == null) return false; + final parentData = _body!.parentData as BoxParentData; + return result.addWithPaintOffset( + offset: parentData.offset, + position: position, + hitTest: (result, position) { + return _body!.hitTest(result, position: position); + }); } @override From 65164f768f60a2956b4fb58f19025b34c60bc41a Mon Sep 17 00:00:00 2001 From: li3317 Date: Thu, 25 Nov 2021 22:42:39 -0500 Subject: [PATCH 2/2] upgrade to 2.0.21 --- CHANGELOG.md | 3 +++ pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ee25198..d35c67ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [2.0.21] +* Handle click on embed object. + ## [2.0.20] * Improved UX/UI of Image widget. diff --git a/pubspec.yaml b/pubspec.yaml index c158fcdc..2b70bb4e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) -version: 2.0.20 +version: 2.0.21 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill