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

Scissors do not disable after most additional touch event #201

Closed
phet-steele opened this issue Aug 11, 2016 · 13 comments
Closed

Scissors do not disable after most additional touch event #201

phet-steele opened this issue Aug 11, 2016 · 13 comments
Assignees
Labels

Comments

@phet-steele
Copy link
Contributor

You can have as many scissors up as desired by just touching vertices consecutively. Touching an empty area will clear all the scissors. This causes an error when done in the following manner:

  1. Go to Build Circuit
  2. Place an element in the box, tap one of its vertices
  3. Switch back to Investigate Circuit
  4. Attempt to switch back to Build Circuit, but get the error below

Beginning of this video just demonstrates the endless scissors.
cckbb02

Uncaught TypeError: Cannot read property 'slice' of undefined
moveToFront @ circuit-construction-kit-black-box-study_en.html:635
E @ circuit-construction-kit-black-box-study_en.html:649
link @ circuit-construction-kit-black-box-study_en.html:626
e @ circuit-construction-kit-black-box-study_en.html:649
b @ circuit-construction-kit-black-box-study_en.html:649
_fireItemAdded @ circuit-construction-kit-black-box-study_en.html:626
push @ circuit-construction-kit-black-box-study_en.html:626
add @ circuit-construction-kit-black-box-study_en.html:626
f @ circuit-construction-kit-black-box-study_en.html:652
(anonymous function) @ circuit-construction-kit-black-box-study_en.html:652
emit2 @ circuit-construction-kit-black-box-study_en.html:626
_notifyObservers @ circuit-construction-kit-black-box-study_en.html:626
_setAndNotifyObservers @ circuit-construction-kit-black-box-study_en.html:626
set @ circuit-construction-kit-black-box-study_en.html:626
fire @ circuit-construction-kit-black-box-study_en.html:651
(anonymous function) @ circuit-construction-kit-black-box-study_en.html:651
n @ circuit-construction-kit-black-box-study_en.html:626
emit2 @ circuit-construction-kit-black-box-study_en.html:626
_notifyObservers @ circuit-construction-kit-black-box-study_en.html:626
_setAndNotifyObservers @ circuit-construction-kit-black-box-study_en.html:626
set @ circuit-construction-kit-black-box-study_en.html:626
set @ circuit-construction-kit-black-box-study_en.html:626
up @ circuit-construction-kit-black-box-study_en.html:646
buttonUp @ circuit-construction-kit-black-box-study_en.html:643
up @ circuit-construction-kit-black-box-study_en.html:643
dispatchToPointer @ circuit-construction-kit-black-box-study_en.html:641
dispatchEvent @ circuit-construction-kit-black-box-study_en.html:640
upEvent @ circuit-construction-kit-black-box-study_en.html:640
touchEnd @ circuit-construction-kit-black-box-study_en.html:640
run @ circuit-construction-kit-black-box-study_en.html:640
fireBatchedEvents @ circuit-construction-kit-black-box-study_en.html:640
batchEvent @ circuit-construction-kit-black-box-study_en.html:640
ontouchend @ circuit-construction-kit-black-box-study_en.html:640

Seen on iOS 9.3.3 and Win 10 Chrome (with a touch screen). For phetsims/tasks/issues/668.
Troubleshooting information:
Name: ‪Circuit Construction Kit: Black Box Study‬
URL: http://www.colorado.edu/physics/phet/dev/html/circuit-construction-kit-black-box-study/1.0.0-dev.22/circuit-construction-kit-black-box-study_en.html
Version: 1.0.0-dev.22 2016-08-02 19:40:14 UTC
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Language: en-US
Window: 1536x739
Pixel Ratio: 2.5/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 30 uniform: 1024
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 16384x16384
OES_texture_float: true
Dependencies JSON:
{"assert":{"sha":"7d27130a","branch":"master"},"axon":{"sha":"1fd91832","branch":"master"},"babel":{"sha":"98628f5a","branch":"master"},"brand":{"sha":"f0b1f7da","branch":"master"},"chipper":{"sha":"2616d1cf","branch":"master"},"circuit-construction-kit-black-box-study":{"sha":"2ee1d54a","branch":"master"},"circuit-construction-kit-common":{"sha":"4facd999","branch":"master"},"dot":{"sha":"6ee3c51e","branch":"master"},"joist":{"sha":"e8a38a2c","branch":"master"},"kite":{"sha":"88f0c3a0","branch":"master"},"phet-core":{"sha":"c48bf320","branch":"master"},"phetcommon":{"sha":"83ea84c8","branch":"master"},"scenery":{"sha":"0318877f","branch":"master"},"scenery-phet":{"sha":"70dd84b7","branch":"master"},"sherpa":{"sha":"5ddfccd4","branch":"master"},"sun":{"sha":"df2905e6","branch":"master"},"tandem":{"sha":"bd7d63a1","branch":"master"}}

@phet-steele phet-steele changed the title Scissors to not disable after most additional touch events Scissors do not disable after most additional touch event Aug 11, 2016
@samreid
Copy link
Member

samreid commented Aug 15, 2016

I'm not seeing this issue when using a mouse, so perhaps it doesn't need to be done for the next study version.

@samreid samreid removed their assignment Aug 26, 2016
@samreid samreid self-assigned this Jan 27, 2017
samreid added a commit to phetsims/circuit-construction-kit-dc that referenced this issue May 22, 2017
@samreid
Copy link
Member

samreid commented May 22, 2017

Testing on iPad3, I saw that multiple vertices plus a circuit could be selected simultaneously even on the DC sim (problem is not specific to Black Box). Proposed fix is in the preceding 2 commits, and published a dev version here for testing: http://www.colorado.edu/physics/phet/dev/html/circuit-construction-kit-dc/1.0.0-dev.23/circuit-construction-kit-dc_en.html

@phet-steele can you take a look?

@samreid samreid assigned phet-steele and unassigned samreid May 22, 2017
@phet-steele
Copy link
Contributor Author

even on the DC sim (problem is not specific to Black Box)

At the time of finding, DC didn't exist 😄!

I checked both dev.23 and dev.29 (latest). The multiple scissors problem is fixed, but I would imagine that touching anything other than a scissor would dismiss the visible scissor? (it doesn't).

For example, with a mouse I can click a vertex for a scissor, then click away and dismiss the scissor (sort of like modal behaviour). Same with a click & drag.

@phet-steele phet-steele assigned samreid and unassigned phet-steele May 23, 2017
@samreid
Copy link
Member

samreid commented May 24, 2017

It would be easy to add a listener to the background. Not sure how to add a listener to "anywhere else". I'll ask around.

@samreid
Copy link
Member

samreid commented May 24, 2017

Oh wait there is already code that is supposed to be doing this:

          vertex.selectedProperty.set( true );

          // When the user clicks on anything else, deselect the vertex
          var deselect = function() {
            vertex.selectedProperty.set( false );
            event.pointer.removeInputListener( listener ); // Thanks, hoisting!
          };
          var listener = {
            mouseup: deselect,
            touchup: deselect
          };
          event.pointer.addInputListener( listener );

@samreid
Copy link
Member

samreid commented May 24, 2017

The multiple scissors problem is fixed, but I would imagine that touching anything other than a scissor would dismiss the visible scissor? (it doesn't).

For example, with a mouse I can click a vertex for a scissor, then click away and dismiss the scissor (sort of like modal behaviour). Same with a click & drag.

Testing http://www.colorado.edu/physics/phet/dev/html/circuit-construction-kit-dc/1.0.0-dev.29/circuit-construction-kit-dc_en.html I see that if I drag out a battery, then click a vertex it becomes selected and the scissors show. Then if I click in the background, the selected vertex becomes unhighlighted and the scissor button disappears. Is this the desired behavior? Are you seeing something else?

@samreid samreid assigned phet-steele and unassigned samreid May 24, 2017
@phet-steele
Copy link
Contributor Author

Then if I click in the background, the selected vertex becomes unhighlighted and the scissor button disappears. Is this the desired behavior?

I would imagine this is desired (it's desired in my book!) which is why I mentioned that it wasn't happening with touch. @arouinfar?

@phet-steele phet-steele assigned samreid and arouinfar and unassigned phet-steele May 24, 2017
@samreid
Copy link
Member

samreid commented May 24, 2017

Sorry, I wasn't testing on touch. I'll take a closer look.

@samreid
Copy link
Member

samreid commented May 24, 2017

New version is published here: http://www.colorado.edu/physics/phet/dev/html/circuit-construction-kit-dc/1.0.0-dev.38/circuit-construction-kit-dc_en.html

I'll test the built version on iPad before sending it back to @phet-steele

@samreid
Copy link
Member

samreid commented May 24, 2017

[5/24/17, 4:16:48 PM] Steele Dalton: needs to disable after a drag too, even if the drag is on a vertex that has scissors already
[5/24/17, 4:30:04 PM] Sam Reid: I see what you mean. Denzel tested that and thought it seemed OK to remain selected over a drag. I’ll test again and try to see it from your perspective.

samreid added a commit that referenced this issue May 24, 2017
@samreid
Copy link
Member

samreid commented May 24, 2017

In the previous commit, the vertex deselects after drag.

@samreid
Copy link
Member

samreid commented May 25, 2017

Dev version posted here for testing:
http://www.colorado.edu/physics/phet/dev/html/circuit-construction-kit-dc/1.0.0-dev.40/circuit-construction-kit-dc_en.html

@phet-steele can you take a look? Note that the "deselect circuit element after dragging" is now a separate issue #333

@samreid samreid assigned phet-steele and unassigned samreid May 25, 2017
@phet-steele
Copy link
Contributor Author

Love it!

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

No branches or pull requests

3 participants