Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new win-pivot-item after removing all, throws exception and breaks first tab #79

Open
sondreb opened this issue Nov 6, 2015 · 0 comments
Milestone

Comments

@sondreb
Copy link
Contributor

sondreb commented Nov 6, 2015

I have a win-pivot-item binded to an array of items, it works fine to add/remove and navigate between the tabs, but if I remove all, there occurs an exception on the first add. After that exception, the first tab is in a "broken" state, not possible to navigate to it. Not only is the first tab broken, the content of the other tabs are not displayed. It is possible to click the headers, but nothing appears.

I have created a codepen to reproduce the issue, but codepen does not supply the JavaScript error that occurs, but the behavior can be tested here.

http://codepen.io/sondreb/pen/VvGNJK

Steps to reproduce:

  1. Open the codepen.
  2. Click the Remove Tab twice.
  3. Click the Add Tab multiple times.
  4. Observe that the content is not shown, and that the first tab is no longer select-able.

This is where the debugger kicks in:

image

Content of data.stack:

"TypeError: Cannot read property 'classList' of undefined
    at HeaderStateStatic.HeaderStateBase.setActiveHeader (http://localhost:7601/libs/lib.js:136105:30)
    at HeaderStateStatic.handleNavigation (http://localhost:7601/libs/lib.js:136198:18)
    at http://localhost:7601/libs/lib.js:135618:37
    at CompletePromise_ctor.CompletePromise_then [as then] (http://localhost:7601/libs/lib.js:75889:49)
    at Pivot._loadItem (http://localhost:7601/libs/lib.js:135607:73)
    at Pivot.Object.defineProperty.set [as selectedIndex] (http://localhost:7601/libs/lib.js:135431:30)
    at Pivot._handleItemInserted (http://localhost:7601/libs/lib.js:135736:36)
    at eventMixin.dispatchEvent (http://localhost:7601/libs/lib.js:74138:34)
    at _Base.Class.define._notifyItemInserted (http://localhost:7601/libs/lib.js:97550:30)
    at _Base.Class.derive.splice (http://localhost:7601/libs/lib.js:99489:34)"

(Posted duplicate of this bug to the WinJS repo, this is probably not a angular+winjs issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants