Two ways to create forms with await and without

Hi,

Why when I use create from with Await the button element is automatically selected?
When I create form without Await its ok ... the buton is unselected.
This is problem when you have mobile app and the app is scrolled to the selected button.

I do this in this way:

procedure TForm1.wbtn2Click(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
  Form2.popup:=False;
  await(TForm2, Form2.Load());
  await(TModalResult, Form2.Execute);
end;

the simple project for repro:
CreateForm.zip (1.4 MB)

When you click button "create form with await" you can see that button is automatically selected after form show. (picture below)

Set button.TabStop = false if you do not want this.

This is not solution because I need tab key response for the buttons.

My question is why we have a different behave when we create form usung old way method:
newform := TForm2.CreateNew(@AfterCreate)

and new using await:

procedure TForm1.wbtn2Click(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
  Form2.popup:=False;
  await(TForm2, Form2.Load());
  await(TModalResult, Form2.Execute);
end;

It should work exactly the same.

OK ... I can see that whether I set TabStop to false the components (buttons, input fields) still respond to the tab on the page :slight_smile: which is a little weird :slight_smile:

Btw for now it is good workaround for this issue.

The problem is with TWebDateTimePicker, tabstop set to false and still focused when the form created with await.

We have seen this issue in TWebDateTimePicker and applied a fix that will be in v2.1