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

Trail enhancements for ComboBox #927

Closed
pixelzoom opened this issue Jan 18, 2019 · 4 comments
Closed

Trail enhancements for ComboBox #927

pixelzoom opened this issue Jan 18, 2019 · 4 comments

Comments

@pixelzoom
Copy link
Contributor

So that I can move forward with phetsims/sun#430 (comment) ...

(1) Please add visibility annotations for Trail fields

(2) Please add containsNode to Trail. Probably some thing like this (untested):

/**
 * Does this Trail contain the specified Node?
 * @param {Node} node
 */
containsNode( node ) {
  return event.trail.nodes.indexOf( node ) !== -1;
}
@pixelzoom
Copy link
Contributor Author

If trail.nodes was intended to be @private, then we have problems. I see 39 occurrences of trail.nodes, several of which are in sim code. And most occurrences are testing to see if a Node is on the Trail.

E.g. fractions-common/BuildingLabScreenView:

const doesTrailMatch = _.includes( event.trail.nodes, screen.view ) || event.trail.length <= 1;

@pixelzoom
Copy link
Contributor Author

If trail.nodes was intended to be public, then you can skip adding containsNode, and probably just document nodes as @public (read-only).

@jonathanolson
Copy link
Contributor

Should be done above. Added containsNode anyways, as it will be more convenient.

Does this look good? (Sorry about the whitespace formatting in the commit)

pixelzoom added a commit to phetsims/sun that referenced this issue Jan 22, 2019
@pixelzoom
Copy link
Contributor Author

👍

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