Add a way to set focus when modal opens (e.g., on Close button) #4525
Unanswered
YuliiaPanova-sap
asked this question in
Q&A
Replies: 1 comment
-
|
Hi @YuliiaPanova-sap , if you want to control the focus behaviour in the core app, you would use the creationInterceptors (https://docs.luigi-project.io/docs/general-settings?section=iframecreationinterceptor, https://docs.luigi-project.io/docs/general-settings?section=webcomponentcreationinterceptor). In the following example i have defined a 'modalFocusMode' node prop that controls two different focus options. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to set focus automatically when a modal is opened using LuigiClient.openAsModal — for example, to place focus on the Close button or on the modal content?
Currently, Luigi does not expose any event or lifecycle hook that triggers after the modal is rendered, making it difficult to manage focus properly. Developers have to rely on unstable workarounds like setTimeout or MutationObserver.
Adding a native way to detect when the modal is opened would allow consistent focus handling and improve accessibility in Luigi-based applications.
Beta Was this translation helpful? Give feedback.
All reactions