Prevent focus on dialog #935
-
I'm trying to prevent focus of first input inside dialog. I've look the docs but couldn't see 😶🌫️ Is there any option to fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @kerimcet, typically you wouldn't want to completely prevent focus inside the dialog otherwise you'll be breaking accessibility. However, if what you want is prevent the default autofocus and focus something else inside the Dialog instead, there most defeinitley is a way to do this. You can simple do |
Beta Was this translation helpful? Give feedback.
-
In my case I actually had to use the opposite - |
Beta Was this translation helpful? Give feedback.
Hi @kerimcet, typically you wouldn't want to completely prevent focus inside the dialog otherwise you'll be breaking accessibility. However, if what you want is prevent the default autofocus and focus something else inside the Dialog instead, there most defeinitley is a way to do this. You can simple do
event.preventDefault()
inContent
'sonOpenAutoFocus
prop and then run your own focus logic in there.