Setting focus on dropdown menu at page loading

Hello Dash world,
I’m trying to get the focus set on a dcc.Dropdown at page loading.
I understand it could be done resorting to a clientside_callback (see for example Is there a way to deselect a dash component (i.e. remove focus)?)
However, I’m working in the context of a multipage dash application, where the layout is defined as a function (to deal with url parameters)
As a result, the clientside_callback generates a “my_component is not defined”, as it appears the callback is set before the creation of the component.
Any idea how to circumvent this issue ?
Many thanks

HI @qwertzu,

what exactly is the error you get? Maybe setting

app = dash.Dash(

does help.

Thanks for the fast reaction !
The proposed settings do not solve the issue.
The error I receive is literally :
ReferenceError: my_component is not defined

at (

at _callee2$ (

at tryCatch (

at Generator._invoke (

at (

at asyncGeneratorStep (

at _next (


at new Promise (<anonymous>)