AutoFill code from OTP SMS in input which is inside a shadow DOM not working

Hi all,

I'm trying to implement an OTP code input that allows auto-complete code from OTP SMS in Safari (IOS 16.2)

When the input is placed in the DOM, everything is working well and I get the option to autofill the code from SMS

But when I placed the same input inside a shadow DOM, I'm not longer get the option to auto fill it from SMS

Is there a way to make it work also for inputs which are inside a shadow DOM?

(Attached sample HTML file that demonstrates the problem)

AutoFill code from OTP SMS in input which is inside a shadow DOM not working
 
 
Q