Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

SourcesTree: (index) click weirdness #5918

Closed
darkwing opened this issue Apr 10, 2018 · 2 comments
Closed

SourcesTree: (index) click weirdness #5918

darkwing opened this issue Apr 10, 2018 · 2 comments
Labels
Milestone

Comments

@darkwing
Copy link
Contributor

darkwing commented Apr 10, 2018

The first time I click on "(index)" in the SourcesTree, the following item is focused:

// console.log'ing from inside `focusItem()`
Object { name: "(index)", path: "https://davidwalsh.name/", contents: {} }
Object { name: "(index)", path: "https://davidwalsh.name/", contents: {} }
Object { name: "root", path: "", contents: [] }

If I click it again, I get:

Object { name: "(index)", path: "https://davidwalsh.name/", contents: {} }
Object { name: "(index)", path: "https://davidwalsh.name/", contents: {} }

The Object { name: "root", path: "", contents: […] } item appears to be what throws the highlight off. We need to figure out where that's coming from to fix this bug.

@darkwing
Copy link
Contributor Author

darkwing commented Apr 10, 2018

The problematic Object { name: "root", path: "", contents: […] } item is coming from ManagedTree:

highlightItem(highlightItems: Array<Item>) {
  // ....

  //... the last line:
  this.focusItem(highlightItems[index]);
}

The index in question is 0. Changing the code to the following appears to fix the issue:

if(index === 0) {
    return;
}

this.focusItem(highlightItems[index]);

@jasonLaster jasonLaster mentioned this issue May 24, 2018
24 tasks
darkwing added a commit to darkwing/debugger.html that referenced this issue Jun 8, 2018
darkwing added a commit to darkwing/debugger.html that referenced this issue Jun 12, 2018
darkwing added a commit to darkwing/debugger.html that referenced this issue Jun 21, 2018
jasonLaster pushed a commit to jasonLaster/debugger.html that referenced this issue Jun 21, 2018
@janodvarko
Copy link
Member

@darkwing How can I reproduce this issue? STR?

Honza

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

No branches or pull requests

2 participants