Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-1795

DatePicker throws "Uncaught TypeError" when getPopover() is called and anything other than trigger is clicked

    Details

      Description

      If datePicker.getPopover() is called, and the datePicker's trigger has not been clicked, an error is thrown.

      Steps to reproduce:
      1. Run the following JavaScript and HTML (jsfiddle provided):

      <html>
          <head>
              <script src="http://cdn.alloyui.com/3.0.0/aui/aui-min.js"></script>
              <link href="http://cdn.alloyui.com/3.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet"></link>
          </head>
          <body>
              <input id="input" />
              <script>
      
      YUI().use('aui-datepicker', function (Y) {
          var datePicker = new Y.DatePicker({
              trigger: '#input'
          });
          datePicker.getPopover();
      });
      
              </script>
          </body>
      </html>
      

      2. Click anywhere EXCEPT on the input/trigger.

      If the bug still exists, you will see the following error in the browser logs:
      Uncaught TypeError: Cannot read property 'contains' of undefined

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              maira.araujo Maíra Araujo (Inactive)
              Reporter:
              kyle.stiemann Kyle Stiemann (Inactive)
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 9 weeks, 3 days ago

                  Packages

                  Version Package
                  2.0.x
                  master
                  master-deprecated
                  3.0.x
                  2.0.0.71-deprecated
                  3.1.x