ID:2960283
 
Resolved
When setting focus to a browser control through winset(), the browser itself (the internal part) didn't believe it was focused because the actual focus was on the outer window holding it.
BYOND Version:516.1650
Operating System:Windows 11 Pro 64-bit
Web Browser:Chrome 131.0.0.0
Applies to:Dream Seeker
Status: Resolved (516.1651)

This issue has been resolved.
Descriptive Problem Summary:

winsetting the focus to a browser control reports that the browser control has focus from BYOND's end. The browser refuses to admit it has focus until the document has been clicked on. I have attempted to, and failed to force the focus using javascript. Until the user clicks into a webview2 element, we cannot migrate the user's focus to the browser. This makes dynamic on-screen inputs impossible with browsers.

Test case uploaded to BYONDiscord

You can check the focus element by hovering over the blue text at the top of the screen.

You can make the browser show up by clicking on the green box at the right of the screen. This should set the user's focus to that browser too.

When you click on the browser, it will detect focus and change the text content. When you click away from the browser, it will send the focus to the map element and hide the browser.
Lummox JR resolved issue with message:
When setting focus to a browser control through winset(), the browser itself (the internal part) didn't believe it was focused because the actual focus was on the outer window holding it.
This still seems to occur for me on 516.1651. Ter's original test case is still valid - BYONDiscord link, as does one I quickly whipped up (BYONDiscord link), on 515 this will focus the input element correctly, on 516 it does not.
In response to Hry
I can't confirm what you're saying, at least not with the alias issue fixed in the input control. The input control has some errors in the test case.
In response to Lummox JR
Sorry - completely idiotic there, used JS syntax when converting it into a one file testcase. This link should demonstrate a test case that, on 515, will have you focused on the input element as soon as the browser window popup shows. However, on 516, this does not happen, and the input element will not have focus.
In response to Hry
Your issue is a race condition and it's separate from this one. It requires a separate bug report.
I've confirmed that this is working for me.

Login to reply.