[TD2025.31550 Win11] Half RFE/ half Bugreport?
When Window COMP is opened it is not properly focused, or previously focused elements become unfocused.
Originally realized this while developing a palette:webBrowser application where I have an HTML that has a search bar. By default this search bar should be focused so when you open the corresponding Window COMP you can instantly search away.
However when the window is opened it is not the case. I tried setting it to foreground explicitly, running javascript to focus the element (even though it is already focused and active by default), running mouse interact to simulate a click in the browser, but no success with either.
So far I was not able to solve this, the user explicitly needs to click inside the Window COMP to interact. (Same btw when using openViewer())
Then I ran an isolated test with an editable Text COMP instead of the browser.
Depending on the order of operations I noticed a similar issue. See my test script below:
def onOffToOn(channel: Channel, sampleIndex: int, val: float,
prev: float):
run(lambda: doWindow(isPerform=True), delayFrames = 0)
run(lambda: doFocus(), delayFrames = 0)
def doWindow(isPerform = False):
window = op('window1')
if isPerform:
window.par.performance.pulse()
else:
window.par.winopen.pulse()
window.setForeground()
def doFocus():
text = op('text1')
text.setFocus()
text.setKeyboardFocus(selectAll=True)
In this default case for example the Text is not focused, have to delay it by 1 frame at least for it to work, regardless if separate or perform.
If you first focus the Text, and then delay the opening of the Window the Text becomes unfocused.
In my opinion the Window COMP should be fully in focus.
Perhaps the webBrowser behavior is a different issue.

