Closed (fixed)
Project:
Navbar
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 May 2013 at 19:45 UTC
Updated:
20 Dec 2013 at 03:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rosberg commentedI am having the exact same problem (Firefox, IE9, and also in IE10).
Comment #2
designerbrent commentedI'm also having the same problem with the dev version pulled October 22.
Comment #3
jessebeach commentedI've reproduced the error in both browsers.
Thank you for logging this error!
I'm looking into it now.
Comment #4
dangermonkey commentedI had the same issue but was able to fix it by updating to jQuery 1.7.1.
Comment #5
jessebeach commentedOh, that's interesting. Any insight into what changed in jQuery 1.7.1 that would resolve this issue?
Comment #6
designerbrent commentedWish I could say that did the trick for me but it's not the case. I'm running jQuery 1.7.1 as well as the most recent Backbone and Underscore libraries with a fairly recent version of NavBar and am still getting the same issue. It's only happening when you go to change tabs, not close the current tab. Closing the tab works normal.
Comment #7
jessebeach commentedOk, so a couple things going on here. Navbar uses Backbone 1.0. Toolbar uses 0.9.2. So we often see bugs in Navbar that we will eventually encounter in Toolbar. The nice part is we get to fix them here first :).
The second part, is that this isn't really a Backbone bug...it's an Underscore bug. Here's the boiled-down proof:
The code from the image above:
_.isEqualis incorrectly true when comparing two different DOM nodes. But this only happens in Firefox (~26) and IE (~9), not Chrome (~32).So, we'll need to store a string or some value that isn't a DOM node as the value of the 'activeTab' model attribute.
Comment #8
jessebeach commentedThis is also a known issue filed against Underscore: https://github.com/jashkenas/underscore/pull/945
Comment #9
jessebeach commentedAlright, give this a go, please.
Comment #10
jessebeach commentedComment #11
jessebeach commentedComment #12
designerbrent commentedThe seems to do the trick!
Comment #13
designerbrent commentedI have noticed that while this does the trick for IE and Firefox when changing tabs, when you just want to close the tap, it is requiring one extra click.
Comment #14
jessebeach commented@designerbrent, great catch. It came down to this code:
The
activeTabwas being retrieved from localStorage and then fetched from the DOM and stored as a node. But I updated the code to store this value as a string representing the ID. So on the first page load, you would need to click on an active tab twice to dismiss it. I've fixed this problem.The diff is attached. I've pushed the fix into the 7.x-1.x dev branch as well (08e5770e1e579ad167a63cb770d816a140adf7af).
tab
I'll also update #2139571: underscore.js fails to compare DOM nodes correctly; Toolbar JS will fail when upgraded to Backbone 1.0.0, since these codebases shouldn't diverge too much.
Comment #15
designerbrent commentedI'd say this fixes the issue. I tested in IE and Chrome this AM and it seem to have fixed all the issues for me.
Comment #16
jessebeach commentedThanks for the follow-up review @designerbrent!