Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-text-float raises error on click #553

Closed
FUT opened this issue Nov 6, 2014 · 8 comments
Closed

md-text-float raises error on click #553

FUT opened this issue Nov 6, 2014 · 8 comments
Milestone

Comments

@FUT
Copy link

FUT commented Nov 6, 2014

I use md-bottom-sheet as a wrapper for the sign in form and md-text-float as inputs:

Image of sign in form

On some devises (e.g. my tablet & chrome emulation of nexus 7) I see that error when I try to click on the field inside the md-bottom-sheet element:

Uncaught TypeError: Cannot read property '0' of undefined angular-material-871f3ed9aaf14330ee72bf77479bbd2b.js?body=1:1160
  getY angular-material-871f3ed9aaf14330ee72bf77479bbd2b.js?body=1:1160
  onTouchStart angular-material-871f3ed9aaf14330ee72bf77479bbd2b.js?body=1:1117
  jQuery.event.dispatch jquery-967caacfe1cc2c76f46786a9e8393bf0.js?body=1:4642
  elemData.handle jquery-967caacfe1cc2c76f46786a9e8393bf0.js?body=1:4310

Here is the angular-material-871f3ed9aaf14330ee72bf77479bbd2b.js?body=1:1160:

    /**
     * Helper function to find the Y aspect of various touch events.
     **/
    function getY(e) {
      var touch = e.touches && e.touches.length ? e.touches[0] : e.changedTouches[0];
      return touch.clientY;
    }

I have inspected code a bit and see that both e.touches and e.changedTouches are null. Thus the last expression e.changedTouches[0] raises the error Cannot read property '0' of undefined.

I am not totally sure why does this happen but if I use the same md-text-float elements outside the md-bottom-sheet they work just well. Am I doing something wrong or is it a bug?

@ThomasBurleson
Copy link
Contributor

@FUT - Not sure why that is happening. We will investigate.
Can you make a plunkr or codepen plz ?

@ThomasBurleson ThomasBurleson added this to the 0.7.0-rc1 milestone Nov 13, 2014
@daclubb
Copy link

daclubb commented Dec 3, 2014

I have same problem , But when I removed jQuery from my project it's gone

@pavel-shirobok
Copy link

@ThomasBurleson @daclubb @FUT I have dirty "solution" for this bug. #927 (comment) Please check it!

@FUT
Copy link
Author

FUT commented Jan 19, 2015

Thanks guys!

@FUT
Copy link
Author

FUT commented Jan 21, 2015

I upgraded the angular material to 0.7.0-rc3 but the bug is still there. Here is the detailed explanation: http://stackoverflow.com/questions/27328271/use-inputs-in-angularjs-material-bottom-sheet

Could you please take a look?

@FUT
Copy link
Author

FUT commented Jan 21, 2015

Can not reopen - created a new one: #1248

@ThomasBurleson
Copy link
Contributor

@FUT - md-text-float has been deprecated. Use the md-input-container; @see https://material.angularjs.org/#/demo/material.components.input

@FUT
Copy link
Author

FUT commented Jan 21, 2015

the issue is repeatable even for simple input.

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

No branches or pull requests

5 participants