TurboDrive fires on forms despite being disabled in Safari 15 beta
See original GitHub issueOver the last week I’ve noticed a big uptick in JS exceptions in my app. All of the exceptions were for browsers running the Safari 15 beta. After investigating, I learned that on a form submission, Turbo Drive would fire even if the submit button had the attribute data-turbo=false
After further investigation, I discovered the submitter
property of the SubmitEvent
was always null. It seems Safari 15 beta now implements the SubmitEvent, but due to a bug in their implementation, they do not populate the submitter
property.
Since the submitter
property is null
TurboDrive cannot inspect its attributes to see if it should delegate control of the form submission back to the browser.
This bug was recently patched, but it is unclear when it will hit Safari 15 beta users, it’s possible it won’t for months.
I’m going to continue looking for the most elegant workaround, but I wanted to raise the issue here in case there was an appetite to extend the existing polyfill to officially fix this unfortunate situation.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:12 (10 by maintainers)
Top GitHub Comments
If anyone is looking for a workaround, I am including this file in my JS bundle and it seems to fix the problem.
It’s basically a ES6 version of the existing polyfill (since I don’t use Typescript in my app) except it forces it on for the broken Safari. Should be safe to run on top of the existing polyfill code.
I’ve just encountered this issue with Safari 15.0 final (16612.1.29.41.4, 16612) on OS X 11.6