Turbo-iOS: Break out of frame?

I have a form input field that changes the content. This content is wrapped inside of a turbo frame tag"

<%= turbo_frame_tag :inventory do %>
content...
<% end %>

“content” has links where I use target: :_top to break out of the frame when clicked else you’d get “Content Missing”. Now I use Turbo iOS. When a link is clicked, it tries to open the browser instead of pushing the view onto the stack. To get around this, I’d have to remove the wrapping turbo frame tag and remove the target attribute which is not ideal. How to solve this?

My turbo ios session:

func session(_ session: Session, openExternalURL url: URL) {
    let safariViewController = SFSafariViewController(url: url)
    present(safariViewController, animated: true, completion: nil)
}

If no solution I’d have to make this page native.

1 Like

I know this is an old post now, but just hit this exact same issue.

Used target: “_top” on a link_to within a turbo frame, and those links now open in a safari modal in turbo-ios. Thankfully I had a keen-eyed user spot this and let me know asap

1 Like