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

Touch events outside of container div throws exception #390

Closed
endeavour opened this Issue Sep 4, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@endeavour

endeavour commented Sep 4, 2015

Consuming Touch.taps causes an exception to be thrown when an Elm moduile is embedded in an HTML page and you tap (or click) outside the container div.

"Uncaught TypeError: Cannot read property 't' of undefined" occurs in the end(e) function.

@endeavour endeavour changed the title from Touch events outside of container div throw exception to Touch events outside of container div throws exception Sep 4, 2015

@eeue56

This comment has been minimized.

Show comment
Hide comment
@eeue56

eeue56 Sep 8, 2015

Contributor

Can you create a short example of this?

Contributor

eeue56 commented Sep 8, 2015

Can you create a short example of this?

@endeavour

This comment has been minimized.

Show comment
Hide comment
@endeavour

This comment has been minimized.

Show comment
Hide comment
@endeavour

endeavour Sep 8, 2015

Run elm-reactor and then browse to bug.html and click on the red div

endeavour commented Sep 8, 2015

Run elm-reactor and then browse to bug.html and click on the red div

@eeue56

This comment has been minimized.

Show comment
Hide comment
@eeue56

eeue56 Sep 9, 2015

Contributor

Looks like the problem is down fact touchstart isn't called, but touchend is when the listener is added to the node Elm is running inside. I've made a PR #400 which should fix this.

A possibly related problem is when you fire touch events onto an element that re-renders itself before you stop touching (i.e trigger touchend), then touchend is never called, meaning until you click again it there will be no signal sent to clear the data. To try this, load the example project up in Chrome, open the dev tools and enable mobile view, with stimulated touch events, and click on the [] in the webpage. I'll make a new issue for that.

Contributor

eeue56 commented Sep 9, 2015

Looks like the problem is down fact touchstart isn't called, but touchend is when the listener is added to the node Elm is running inside. I've made a PR #400 which should fix this.

A possibly related problem is when you fire touch events onto an element that re-renders itself before you stop touching (i.e trigger touchend), then touchend is never called, meaning until you click again it there will be no signal sent to clear the data. To try this, load the example project up in Chrome, open the dev tools and enable mobile view, with stimulated touch events, and click on the [] in the webpage. I'll make a new issue for that.

@endeavour

This comment has been minimized.

Show comment
Hide comment
@endeavour

endeavour Sep 9, 2015

Thank you!

endeavour commented Sep 9, 2015

Thank you!

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

No more Touch

Member

evancz commented May 11, 2016

No more Touch

@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