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

typeerror (undefined) in touch 'end' function #461

Closed
bburdette opened this Issue Dec 13, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@bburdette

bburdette commented Dec 13, 2015

I've got a project where I have a bunch of SVG controls, which respond to either touch or mouse input. If I use the touch signal (passing it in to the startapp 'inputs') then I get an error after randomly clicking around among the controls. This is using the mouse on my laptop, which isn't a touch device.

The error occurs in the 'end()' function, which is inside Elm.Native.Touch.make. Specifically the var 't' is undefined. The error occurs in the 'if' comparison, "if (localRuntime.timer.now() - t.t < tapTime)".

  function end(e) {
    var t = dict.remove(e.identifier);
    if (localRuntime.timer.now() - t.t < tapTime)
    {
      hasTap = true;
      tap = {
        x: t.x,
        y: t.y
      };
    }
  }

There is a pull request from this issue https://github.com/elm-lang/core/issues/390 which purports to solve the problem (or a similar problem), but for me the type error still occurs. Pull request: https://github.com/elm-lang/core/pull/400

I gave that a try by manually applying the patch to an html page built with elm-make.

Its not exactly a minimal example. but you can reproduce this error by checking out my project 'oscpad' and running /elm/RunMe.elm with elm-reactor. I may try to find a workaround so for future reference the bug occurred in commit bcef5c3d27066f15642ba56f21a1040fa832256c.

@bburdette

This comment has been minimized.

Show comment
Hide comment
@bburdette

bburdette Dec 13, 2015

Tested with Chromium Version 45.0.2454.101 (64-bit) and with Firefox nightly 42.0.
And, elm 0.16 with "elm-lang/core": "3.0.0" according to the elm-stuff/exact-dendencies.json

bburdette commented Dec 13, 2015

Tested with Chromium Version 45.0.2454.101 (64-bit) and with Firefox nightly 42.0.
And, elm 0.16 with "elm-lang/core": "3.0.0" according to the elm-stuff/exact-dendencies.json

@bburdette

This comment has been minimized.

Show comment
Hide comment
@bburdette

bburdette Jan 2, 2016

For me I fixed it by removing the code that appears to emulate mousemove. Maybe the way to go would be to put this emulation code somewhere else? Or allow deactivating it. bburdette@fc240a3

bburdette commented Jan 2, 2016

For me I fixed it by removing the code that appears to emulate mousemove. Maybe the way to go would be to put this emulation code somewhere else? Or allow deactivating it. bburdette@fc240a3

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Touch is not handled by core anymore. There is support for http://elm-lang.org/examples/drag stuff at the moment, but it's not super easy for touch yet.

Member

evancz commented May 11, 2016

Touch is not handled by core anymore. There is support for http://elm-lang.org/examples/drag stuff at the moment, but it's not super easy for touch yet.

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment