I’ve defined an event in a Spine.js controller like so in CoffeeScript:
class Charter extends Spine.Controller
events:
'tap #update': 'update'
constructor: (params) ->
super
update: (e) ->
dosomething()
false
When clicking on the #update link, the update function is called, but the link is also activated and directs the browser to the URL.
I’ve tried e.preventDefault(), e.stopPropagation(), and returning false to no avail.
The event seems to be properly formed, with the currentTarget being the #update link so I am wondering if it is something unique to the way Spine is handling the event (I had no trouble with this in Backbone.js)
In spine’s touch.coffee the following code is what has been causing this error:
The mobile device doesn’t receive any of the
clickevents that would firehyperlinks, or submit events when hitting the native form submit (goon iOS’s keyboard).The only solution I could find was to not use
tapevents at all, and useclick– even for mobile browsers.Obviously this isn’t optimal, and am eager for a better solution.