Closed pbmarcano closed 7 years ago
It's hard to troubleshoot without a reproducible sample I can run. I don't see anything in Turbolinks specifically that should affect this. A few questions/suggestions:
configuration.preferences.setValue(true, forKey: "allowFileAccessFromFileURLs")
WKNavigationDelegate
methods and see if they're being called? Specifically, try implementing webView(decidePolicyFor...)
and return .allow
. The default implementation may be canceling the form submission - https://github.com/turbolinks/turbolinks-ios/blob/master/Turbolinks/Session.swift#L272WKWebView
in the app and try it? You should be able to make a new WKWebView
based view controller that doesn't use TL in the same app to test.Hi @zachwaugh,
print()
commands to see if they are called, nothing seems to have fired.import UIKit
import WebKit
class NewLetterViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let myURL = URL(string: "\(host)/letters/new")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}
}
If it helps you identify my problem, and if you don't mind, I'll happily grant you access to the repo for the rails app & the iOS app.
Turns out, I was able to overcome this buy using this gem in Rails: https://github.com/JangoSteve/remotipart
@pbmarcano - what version of Rails are you using? We have same issue. Do you know if gem works on rails 5?
@annieogrady Yep, using Rails 5.
gem 'remotipart', '~> 1.3', '>= 1.3.1'
is in my Gemfile
and
//= require jquery2
//= require materialize-sprockets
//= require turbolinks
//= require jquery_ujs
//= require jquery.remotipart
//= require_tree .
is my app/assets/javascripts/application.js
.
The documentation suggest you put //= require jquery.remotipart
immediately after loading jquery_ujs
.
I ran into issues if I loaded any conflicting javascript afterwards. So I made it the very last import before require_tree.
. Hope this helps you.
thanks for quick response - going to give it a try…
On Thu, Aug 31, 2017 10:39 AM, Pete Marcano notifications@github.com wrote: @annieogrady Yep, using Rails 5.
gem 'remotipart', '~> 1.3', '>= 1.3.1' is in my Gemfile
and
//= require jquery2 //= require materialize-sprockets //= require turbolinks //= require jquery_ujs //= require jquery.remotipart //= require_tree .
is my app/assets/javascripts/application.js.
The documentation suggest you put //= require jquery.remotipart immediately after loading jquery_ujs.
I ran into issues if I loaded any conflicting javascript afterwards. So I made it the very last import before require_tree.. Hope this helps you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Annie O'GradyCo-founderAgentBright, Inc3544 Crown Point RoadLouisville, TN 37777 860-575-6950
I no longer have this issue, so I am closing this.
Hi, this issue is similar to #91, but nothing there seems to help my situation.
So I have a form that has a few fields, and it submits perfectly fine when I leave the
input type="file"
field empty. (I'm using rails, so its more like<%= f.file_field :photos, multiple: true %>
)But when it has any photos or files in it, it hangs on the submit button and never actually submits the form.
Observe:
Now, I opened the same project up in the good ol' Safari Web browser, and the same steps work perfectly fine as expected.
It's a relatively boilerplate turbolinks-ios and rails app. I have a TurbolinksController that does most of the heavy lifting, and each tabbed view simply overrides the URL as per this tutorial.
I have enabled the
Privacy - Camera Usage Description
&Privacy - Photo Library Usage Description
texts in the info.plist as well, in case you were wondering.Here is the TurbolinksController I am using —> https://gist.github.com/pbmarcano/fba748a55931c6ca41e8caa84fbc8093
Please help. What am I missing? What don't I understand?!