diff --git a/lib/common/widgets/text_field/controller.dart b/lib/common/widgets/text_field/controller.dart index a17a0d591..bcfab829e 100644 --- a/lib/common/widgets/text_field/controller.dart +++ b/lib/common/widgets/text_field/controller.dart @@ -917,7 +917,7 @@ class RichTextEditingController extends TextEditingController { } if (offset > range.start && offset < range.end) { if (e.isRich) { - if (offset < value.selection.baseOffset) { + if (offset < selection.baseOffset) { return newSelection.copyWith( baseOffset: range.start, extentOffset: range.start); } else { diff --git a/lib/models/dynamics/result.dart b/lib/models/dynamics/result.dart index 92ca22ec8..bf301ff6c 100644 --- a/lib/models/dynamics/result.dart +++ b/lib/models/dynamics/result.dart @@ -41,12 +41,12 @@ class DynamicsDataModel { continue; } if (enableFilter && - banWordForDyn.hasMatch( - item.orig?.modules.moduleDynamic?.major?.opus?.summary?.text ?? - item.modules.moduleDynamic?.major?.opus?.summary?.text ?? - item.orig?.modules.moduleDynamic?.desc?.text ?? - item.modules.moduleDynamic?.desc?.text ?? - '')) { + banWordForDyn.hasMatch((item.orig?.modules.moduleDynamic?.major + ?.opus?.summary?.text ?? + '') + + (item.modules.moduleDynamic?.major?.opus?.summary?.text ?? '') + + (item.orig?.modules.moduleDynamic?.desc?.text ?? '') + + (item.modules.moduleDynamic?.desc?.text ?? ''))) { continue; } if (filterBan && diff --git a/lib/pages/dynamics/widgets/vote.dart b/lib/pages/dynamics/widgets/vote.dart index 002c1d8a2..b52cb2f66 100644 --- a/lib/pages/dynamics/widgets/vote.dart +++ b/lib/pages/dynamics/widgets/vote.dart @@ -91,28 +91,30 @@ class _VotePanelState extends State { if (_enabled) Padding( padding: const EdgeInsets.only(top: 16), - child: OutlinedButton( - onPressed: groupValue.isNotEmpty - ? () async { - final res = await widget.callback( - groupValue, - anonymity, - ); - if (res.isSuccess) { - if (mounted) { - setState(() { - _enabled = false; - _showPercentage = true; - _voteInfo = res.data; - _percentage = _cnt2Percentage(_voteInfo.options); - }); + child: Obx( + () => OutlinedButton( + onPressed: groupValue.isNotEmpty + ? () async { + final res = await widget.callback( + groupValue, + anonymity, + ); + if (res.isSuccess) { + if (mounted) { + setState(() { + _enabled = false; + _showPercentage = true; + _voteInfo = res.data; + _percentage = _cnt2Percentage(_voteInfo.options); + }); + } + } else { + res.toast(); } - } else { - res.toast(); } - } - : null, - child: const Center(child: Text('投票')), + : null, + child: const Center(child: Text('投票')), + ), ), ), ],