-
Notifications
You must be signed in to change notification settings - Fork 12
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
Unexpect behavior of pdomOrder. #1452
Comments
Yes, that is correct. Everything that is not listed in a PDOM order gets added to the end by default. The documentation is admittedly lengthy but appears here:
So you can do things like // put myNode first, then use default rendering order
this.pdomOrder = [ myNode ];
// put the ResetAllButton last, behind default rendering order
this.pdomOrder = [ null, resetAllButton ]
// myNode first, resetAllButton last, otherwise default rendering order
this.pdomOrder = [ myNode, null, resetAllButton ] |
Questions: (1) Why is this behavior desirable? I don't understand the advantage of this feature, especially when we've established that (in general) one should not rely on the order of a Node's children, except for scenery layout Nodes. (2) If I don't want something to be in the traversal order, how do I prevent that? (3) Should this info be in the quickstart guide? |
This API predates that decision by a couple of years. I understand it is better for PhET to make the order explicit but I think this behavior is useful, nice to have generally, and not worth removing.
I added a note in the quickstart guide about the focusable setter. The other features of |
I disagree. I've added this to the end of the Traversal Order section:
|
While working on phetsims/mean-share-and-balance#47 with @marlitas, we were very confused with how
pdomOrder
was working. Nodes that we did not include in pdomOrder (for example,this.resetAllButton
) were being mysteriously tacked onto the end of the traversal order that we were explicitly setting viasetPDOMOrder
.@marlitas remembered from a conversation with @jessegreenberg that he said that this is expected behavior, and that "leftover" focusable Nodes are placed at the end of the pdomOrder. @jessegreenberg is that true? It's the first I've heard of this. It's not mentioned in the documentation for ParallelDOM
setPDOMOrder
. It's not mentioned in alternative-input-quickstart-guide.md. And it's very confusing.The text was updated successfully, but these errors were encountered: