This is a migrated thread and some comments may be shown as answers.

PopOver On Mobile -- Orientation Change Bug?

1 Answer 53 Views
PopOver (Mobile)
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 28 Oct 2014, 07:40 PM
Hi, I am using the Popover control on a web app which is intended to be cross-platform from desktop to tablet.  On tablet devices, if a popover is open when the device orientation changes, the popover does not relocate itself to the correct relative position.  See this jsbin from an iPad for an example:

http://jsbin.com/jomehotuka

Can this be fixed, or is there a workaround known to work well?

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 30 Oct 2014, 12:39 PM
Hello Rob,

the mobile popover (like all Kendo UI popups) should close when orientation changes or scrolling occurs. In general, it would be great if the popups could re-position themselves in these cases, but in practice this implementation is quite complex and we haven't done that yet. For some reason, the orientation change does not always close the popover, though. 

The simplest workaround I can come up with is the following:

window.addEventListener("orientationchange", function() {
    var popover = $('[data-role=popover]').data('kendoMobilePopOver');
      if (popover) {
        popover.close();
      }
}, false);

This reliably closes the popover when the orientation changes, at least in my tests. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
PopOver (Mobile)
Asked by
Rob
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or