mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-30 01:37:50 +00:00
fix(web): popup key positioning logic
This commit is contained in:
parent
76f907cc0e
commit
8dff00c93d
1 changed files with 6 additions and 2 deletions
|
|
@ -1789,8 +1789,12 @@ namespace com.keyman.osk {
|
|||
|
||||
// And correct its position with respect to that element
|
||||
ss=subKeys.style;
|
||||
var x=dom.Utils.getAbsoluteX(e)+0.5*(e.offsetWidth-subKeys.offsetWidth), y,
|
||||
xMax=(util.landscapeView()?screen.height:screen.width)-subKeys.offsetWidth;
|
||||
var x=dom.Utils.getAbsoluteX(e)+0.5*(e.offsetWidth-subKeys.offsetWidth);
|
||||
|
||||
// https://stackoverflow.com/questions/28083715/how-to-detect-if-a-mobile-device-is-emulated-by-google-chrome
|
||||
// (Note the last reply to the accepted answer.)
|
||||
var flipScreenDims = util.landscapeView() && util.device.OS == 'iOS' && navigator.maxTouchPoints !== 1;
|
||||
var xMax= (flipScreenDims ? screen.height : screen.width) - subKeys.offsetWidth;
|
||||
|
||||
if(x > xMax) {
|
||||
x=xMax;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue