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

Field editor triggered by drag from flyout on touch devices #277

Closed
drigz opened this issue Apr 22, 2016 · 2 comments
Closed

Field editor triggered by drag from flyout on touch devices #277

drigz opened this issue Apr 22, 2016 · 2 comments
Labels
Milestone

Comments

@drigz
Copy link
Collaborator

drigz commented Apr 22, 2016

If you touch the field of a block in the flyout, then try to drag it, it will open the editor after your drag completes. On a desktop browser, this does nothing.

field dragging
dragging on Chrome on Nexus 9, a916f82

I've not looked in to the cause of this. I guess it's to do with touchstart/end being handled differently to mouseup/down.

While the editor clearly shouldn't be opened in this case, do you think the block should be draggable by its field? Blocks are draggable by their fields when they're in the workspace. Upstream Blockly has the same behaviour (allows it in the workspace, doesn't in the flyout).

@tmickel
Copy link
Contributor

tmickel commented Apr 27, 2016

We think the current behavior in Blockly doesn't make sense in touch or in mouse...

Instead, the field editor should only open when tapped. When you drag on the field editor, it should either create a new block or scroll the flyout, just like dragging on a block. This would be more consistent with how fields behave in the workspace itself.

@tmickel tmickel added this to the May 19 milestone Apr 27, 2016
@tmickel tmickel modified the milestones: Backlog, May 19 Apr 29, 2016
@drigz
Copy link
Collaborator Author

drigz commented May 6, 2016

(Note: I've moved this comment across as I originally posted it on the wrong issue)

I've looked further into this, and found out two things.

I've put together a patch that allows the blocks to be dragged by the fields. However, I needed to differentiate between clicks and drags on the fields, and the cleanest way to do this was to make the behaviour in closeable flyouts the same as in fixed flyouts:

  • You can also scroll closeable flyouts by dragging horizontally.
  • Clicking a block in a closeable flyout no longer drops it directly into the workspace, but instead does nothing.

@tmickel, would these changes be undesirable?

Alternatively, we could just add a check in touchend that makes sure the touch is over the element (related Stack Overflow question).

@tmickel tmickel modified the milestones: July 21, Backlog May 12, 2016
@thisandagain thisandagain modified the milestones: August 18, July 21 Jun 24, 2016
@thisandagain thisandagain modified the milestones: Backlog, August 18 Jul 25, 2016
picklesrus pushed a commit to picklesrus/scratch-blocks that referenced this issue Aug 4, 2017
…ton-position

fix scratchfoundation#108 add button is not centered in firefox
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

4 participants