cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Build Apps / Focus input not working

prpa
Explorer
0 Kudos

Hi,

Has anybody already used the View Function "Focus input"?

Expectation:

If the Focus input function is used on a the Event "Page mounted" I would expect to set the cursor focus on the field, that was chosen behind the focus input function.

prpa_1-1711377580776.png

Result:

Currently the focus isn't set on the expected field and the browser dev tools are giving me the following error message:

prpa_0-1711377440095.png

Any ideas? Am I doing something wrong or is this a bug?

Regards,
Patrick

SAP Build SAP Build Apps 

Accepted Solutions (1)

Accepted Solutions (1)

mihaly-toth-nc
Explorer

Hello there,

Well, my initial idea would be that the 'Focus input' only works with the primitive input field. 

Please attempt a scenario where you would use the primitive input instead of the 'Input field' component as shown here:

mihalytothnc_0-1711378666717.png

I understand that this would require you to wrap it into a container and add a text element if you want to also have a label, but if you need focus triggering automatically this is your quickest way of implementing it. 
Finally, a friendly suggestion make sure to name every component with a meaningful name, so that you can potentially easily identify your components in the selection windows. 

Best wishes. 

PS. We have utilised this on our login page to automatically send the user to the email input if the page is loaded, and also on some other locations throughout our application. 

 

prpa
Explorer
0 Kudos

Hi @mihaly-toth-nc 

Thank you very much for the feedback.

This solved my issue 🙂 It was the usage of the primitive input. I was not aware of that.

Thank you very much.

Regards,

Patrick

prpa
Explorer
Hi Mihaly

Answers (0)