-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Popup doesn't take into account positionTo on resize? #4905
Comments
The same related also to |
By design popups are always positioned to the window. The main reasons are prevent jumping and ensure the popup is not out of view after resize / orientation change. |
@uGoMobi Thanks for clarifying... May be jqm should have this notes in code or document?
But it's not prevented because jump exist from And also I am not sure that this is correct to allow a user to pass calculated What about my case: I want to position error popup (like a tooltip) to fixed header? I think this should be possible without jumping and out of view or? |
I understand your point and actually I am also very much in favor using the positionTo after resize as well. |
Any chance this will be fixed in one of the next releases ?? I have issues with this especially on input fields, where phones bring up their softkeyboards - so a resize is fired. Dialogs were not so much an option, so I helped myself so far by doing this: $.mobile.window.resize(function(e){ ...far from ideal, but surprisingly the popup seems to stay where it was... |
I've modified the popup's "popupbeforeposition" event. It now passes along a structure that contains the positioning data it will use upon repositioning. So, basically the same stuff you would pass to open (x, y, positionTo). You can modify this structure to get the effect you want: $( "#myPopup" ).on( "popupbeforeposition", function( e, data ) {
delete data.x;
delete data.y;
data.positionTo = "#myLink";
}); Note that a value of "origin" will not work as the value for data.positionTo, because the information about the origin (that is, the link associated with the popup) has been lost by the time popupbeforeposition rolls around. But, if you tag your link with an ID, you can pass it into positionTo, and it will be used to centre the popup over the element selected by it. |
@gabrielschulhof But I'm beginning to think that input fields in popups on an Android 2.3.4 phone just may not be a good idea for now...all kinds of things happen when user inputs text: resizes, url bar coming down and going up and what not. |
When I use
positionTo="origin"
orpositionTo="#selectors..."
I expect that after window resize popup will adjust position according topositionTo
option.Test case:
window
-> Not as I expect based onpositionTo
option.Reproduced on Windows 7 SP1 x64 + Chrome (21.0.1180.83 m)
The text was updated successfully, but these errors were encountered: