-
Notifications
You must be signed in to change notification settings - Fork 37
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
Highlighter #31
Highlighter #31
Conversation
src/publisher/highlighter.ts
Outdated
} | ||
|
||
stopInspect() { | ||
window.removeEventListener('click', this.onClick, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not remove a listener since onClick
was added as this.onClick.bind(this)
. The same for onPointerDown
& onPointerUp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/publisher/highlighter.ts
Outdated
} | ||
|
||
private selectFiberForNode(node, selected = false) { | ||
const rendererInterface = this.hook.rendererInterfaces.get(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to iterate through rendererInterfaces
and try every interface (supported=true) for a fiber id. Since multiple renderers are not supported, your can add a break after first check, but add a comment for future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/publisher/highlighter.ts
Outdated
} | ||
|
||
if (fiberID) { | ||
this.publisher.ns(HIGHLIGHTER_NS).publish({ fiberID, selected }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to keep this functionality abstract to communication layer. It's better to pass a callback to highlighter to specify what to do on a fiber selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@exdis Great job! Thank you! |
Highlighter initial implementation