AaronX Posted December 21, 2017 Report Share Posted December 21, 2017 In the last two releases I've had - 5.1.4.3000 and 5.1.4.2100 - JavaScript event.preventDefault appears to be suddenly being ignored. With jQuery, I've got the following snippet of code and HTML: $("a.tag-link").click(function(e) { e.preventDefault;// this fails $('#' + $(this).data('target')).tokenInput('add', {id: $(this).data('id'), name: $(this).data('name')});// this executes fine }); <a href="#" class="tag-link" data-target="tags" data-id="171" data-name="airport" tabindex="-1">airport</a> All the data attribute stuff works fine, that JavaScript/jQuery executes correctly and as expected. It's the preventDefault on the actual link click that is failing: the displayport jumps to the top of the page, as would normally be expected from href="#" Link to comment Share on other sites More sharing options...
AaronX Posted January 25, 2018 Author Report Share Posted January 25, 2018 I'm still (v5.1.6.1000) experiencing the above issue with e.preventDefault; being ignored. Can anyone advise or reproduce? Link to comment Share on other sites More sharing options...
7twenty Posted January 27, 2018 Report Share Posted January 27, 2018 Something for the Bug*'s to speak to the devs about. @BugSir006 @BugMiss006 Link to comment Share on other sites More sharing options...
BugSir006 Posted January 29, 2018 Report Share Posted January 29, 2018 e.preventDefault is just a method, could you please try with e.preventDefault() instead? Link to comment Share on other sites More sharing options...
AaronX Posted February 15, 2018 Author Report Share Posted February 15, 2018 On 29/01/2018 at 5:52 AM, BugSir006 said: e.preventDefault is just a method, could you please try with e.preventDefault() instead? Ahhhh! Doi. Of course - thanks! Odd that it was working previously. All fixed now. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.