Be careful with WebTextFields inside WebRectangles and GotFocus

If you use 2 WebRectangles with WebTextFields in them on a page and rely on GotFocus, you will have 2 GotFocus events fired from different WebTextFields when you click a WebTextField in one WebRectangle and then another WebTextField in the other WebRectangle.

Here is an image that may explain the problem (if not, I will upload a video when I create the bug case):

I started the App and when I changed to see the Xojo messages and back I had the 2 A1 got focus events (once when the app was launched and another when the app gets focused again after switching to Xojo to change to messages)

  • then I clicked B3, and you see 2 GotFocus events fired one for B3 and the other for B1, the focus ring stayed with B1 and not B3
  • then I clicked A2, and again got 2 GotFocus events one for A2 and the other for A1, A1 kept the focus ring
  • then I clicked B2, the focus ring was in B3 (the one I clicked before)
  • then I clicked A3, the focus ring was in A2 (the one I clicked before)

What I expect is to only get GotFocus once and the focus ring is shown on the WebTextField that I click and not the one I clicked before (see the image with the last focus ring).

66466 - Double GotFocus (different WebTextFields) if you alternate clicking WebTextFields inside different WebRectangles

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.