-
Notifications
You must be signed in to change notification settings - Fork 5
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
Grabbed tool should pop to the front #450
Comments
Measuring tape now moves to the front in the mentioned issue. |
Implemented and would be nice to have some QA testing for this feature. |
Works in dev.24 |
There is a natural place we could add a |
What is the desired behavior? I'm still very uneasy about having a default "moveToFront" inside a component (but I guess you can always wrap it with a Node if desired?)
That seems like something that might be nice to have for this and other reasons. I think the better approach is to NOT have moveToFront baked into StopwatchNode (especially just in the dragTarget!!!), but instead a client can add a listener to it that moves it to the front when interacted with. |
I discussed with @arouinfar and we agreed that it's not a blocking publication issue that clicking the buttons doesn't bring the stopwatch to the front. Since waves intro 1.1.0-rc.3 moves the stopwatch node to front for all except for the buttons, I'll remove this issue from the milestone.
That seems like a nontrivial issue which would probably need to be discussed with the dev team, and may go against parts of the decision in phetsims/scenery-phet#608 (comment). Up to @jonathanolson if we should open an issue for that. |
Or, presumably we'd want all StopwatchNodes to moveToFront with the buttons, so StopwatchNode could create a listener on ALL of itself? |
This patch seems to be working OK, is it what you had in mind? Index: js/StopwatchNode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/StopwatchNode.js b/js/StopwatchNode.js
--- a/js/StopwatchNode.js (revision 18007999e489b1f4709ac13fb18695329d80b9d4)
+++ b/js/StopwatchNode.js (date 1611963761694)
@@ -159,7 +159,7 @@
const stopwatchVisibleListener = visible => {
this.visible = visible;
if ( visible ) {
- this.moveToFront();
+ // this.moveToFront();
}
else {
@@ -205,7 +205,7 @@
// The StopwatchNode always calls moveToFront on drag start
const startOption = dragListenerOptions.start;
dragListenerOptions.start = () => {
- this.moveToFront();
+ // this.moveToFront();
startOption && startOption();
};
@@ -238,6 +238,10 @@
// @private
this.numberDisplay = numberDisplay;
+ this.addInputListener( {
+ down: () => this.moveToFront()
+ } );
+
// support for binder documentation, stripped out in builds and only runs when ?binder is specified
assert && phet.chipper.queryParameters.binder && InstanceRegistry.registerDataURL( 'scenery-phet', 'StopwatchNode', this );
}
@@ -293,7 +297,7 @@
* @param {Object} [options]
* @returns {function(time:number):string} - see NumberDisplay options.numberFormatter
*/
- static createRichTextNumberFormatter( options ){
+ static createRichTextNumberFormatter( options ) {
options = merge( {
|
I noticed the patch doesn't pop it to the front when dragging out of the toolbox though. |
Presumably we'd want to handle touch-snag and the toolbox pattern! Having a DragListener with |
I'll move the latter part of the conversation to a new issue in scenery-phet. |
Since this issue is non-blocking for Waves Intro, I'm unassigning. We can continue in phetsims/scenery-phet#659 as appropriate |
From #434
When grabbing a tool, it should go to the front (in z-ordering) relative to other grabbable tools. This will not be fixed for 2.0.
The text was updated successfully, but these errors were encountered: