JQuery simplemodal autoposition fails when focused on a textbox in webkit -
i'm using simplemodal 1.4.4 , has strange behavior when open page on ipad.
the modal has autoposition set true. when loads, shows modal centered successfully.
inside modal, have textboxes user , password. when focused on user textbox, virtual keyboard opens, shrinking viewport, modal continues on position, , that's ok.
actually, problem when type something. strange behavior occurs, modal "moves" pixels up. , textbox becomes hidden.
i found common behavior, if scroll page see texbox hidden, clear texbox , enter new value, moves or down "same" amount of pixels scroll i've made.
summing up: looks autopositioning modal every time enter value on textbox, , calculation based on scroll made:
- if make small scroll, , enter new value on textbox, popup moves little.
- if make long scroll, , enter new value on textbox, popup moves far away.
if disable autoposition, doesn't happen, popup becomes invisible due css values has default.
my options are:
- to disable autoposition, set position:relative on popup-container , change popup margins center on screen
- to find possible workaround using autoposition.
i'm willing use second approach, need investigate further or know if has had kind of behavior , difficulty.
thanks in advance!
use "fixed" option:
$(element).modal({fixed: false}); proof - https://code.google.com/p/simplemodal/issues/detail?id=80
my code
$.modal(data, { minwidth: 350, maxwidth: 400, maxheight: 450, autoresize: false, overlayclose: false, fixed: false, opacity: 80, onshow: runpopup });
Comments
Post a Comment