浏览代码

Fixed readonly issue

Tig 1 年之前
父节点
当前提交
23394c10a2
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Terminal.Gui/Views/TextView.cs

+ 6 - 1
Terminal.Gui/Views/TextView.cs

@@ -6067,7 +6067,12 @@ public class TextView : View
     {
         ResetColumnTrack ();
 
-        if (!AllowsReturn || _isReadOnly)
+        if (_isReadOnly)
+        {
+            return false;
+        }
+
+        if (!AllowsReturn)
         {
             // By Default pressing ENTER should be ignored (OnAccept will return false or null). Only cancel if the
             // event was fired and set Cancel = true.