Page MenuHomeFeedback Tracker

Control loses focus by executing ctrlShow
Feedback, NormalPublic


A test mission is attached. The setup is pretty specific.
The following UI setup:

  • Search bar (CT_EDIT)
    • Subgroups (same CT) containing
      • A structured text control (most likely any other interactable control)
  • Another focusable control

When searching something the entries get removed by hiding them via

_x ctrlShow false;

and showing them vice versa.
When clicking on the structured text control and then try to search again the focus of the edit control is lost and set to another control on the display (in the example it is the cancel button). Commenting out the ctrlShow line focus is maintained.


Operating System
Windows 10 x64
Menu UI
Steps To Reproduce
  • Create the display by executing
execVM "test.sqf";
  • Search something (eg. "rahim")
  • Delete the search
  • Click on one of the entries
  • Search again

At this point focus is lost after a few keystrokes.

Additional Information

productVersion: ["Arma 3","Arma3",207,148076,"Diag",true,"Windows","x64"]

Event Timeline

7erra created this task.Sep 7 2021, 1:03 AM
7erra renamed this task from Control looses focus by executing ctrlShow to Control loses focus by executing ctrlShow.
7erra updated the task description. (Show Details)Sep 7 2021, 1:06 AM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.EditedSep 7 2021, 2:52 PM

Ay yai yai! You SPAWN search script on each key push and you dont even wait until it is finished! You can have millions of search scripts running at the same time without any order. try ["search", _this] call SELF;

BIS_fnc_KK changed the task status from New to Feedback.Sep 7 2021, 2:52 PM
7erra added a comment.Sep 7 2021, 5:01 PM

Problem with that is that the KeyDown EH fires before the change is applied, i.e. the text is not up-to-date. So you type "rahim" and it will search for "rahi".

7erra added a comment.Sep 7 2021, 5:39 PM

Changing the KeyDown EH to a KeyUp EH sovles the problem of having to use spawn, call can be used instead. Focus is still lost though.

try RscEdit instead of ctrlEdit