Browse Source

Fixed Charmap focus bug

Tig 1 year ago
parent
commit
eecb7dc7ef
1 changed files with 7 additions and 5 deletions
  1. 7 5
      UICatalog/Scenarios/CharacterMap.cs

+ 7 - 5
UICatalog/Scenarios/CharacterMap.cs

@@ -870,16 +870,11 @@ internal class CharMap : View
             return;
         }
 
-        args.Handled = true;
-
         if (me.Y == 0)
         {
             me.Y = Cursor.Y;
         }
 
-        if (me.Y > 0)
-        { }
-
         if (me.X < RowLabelWidth || me.X > RowLabelWidth + 16 * COLUMN_WIDTH - 1)
         {
             me.X = Cursor.X;
@@ -905,6 +900,13 @@ internal class CharMap : View
             Hover?.Invoke (this, new (val, null));
         }
 
+        if (!HasFocus && CanFocus)
+        {
+            SetFocus ();
+        }
+
+        args.Handled = true;
+
         if (me.Flags == MouseFlags.Button1Clicked)
         {
             SelectedCodePoint = val;