Jump to content

Reflect the problem of interface displacement again


powergov

Recommended Posts

with some browser,For example,  Wechat's browserimage.png.87ec929abfcd43147855e2ae76329d0c.png

Before input

image.thumb.png.f880986105cc5a7b860270ac7ec3928c.png

When input, IOS moves the interface up,like this

image.thumb.png.0a2bea877a3c2b1631420cbe54a45199.png

But when the input is complete, IOS restores the interface to the position before the exhaled keyboard, but unigui does not get the restored position.

 

This problem does not occur in the browsers that come with IOS or Android's own browsers, but it happens as long as the browsers that come with wechat under ios.

And we use Wechat here is the most common, think that such a simple input problem can not be solved, there is no way to put into practice.

 

 

 

 

 

 

image.png

Link to comment
Share on other sites

@Sherzod

My solution to searching for someone else is to scroll the page when the input box loses focus, code as follows:
function kickBack() {

setTimeout(() => {
    window.scrollTo(0, document.body.scrollTop + 1);
    document.body.scrollTop >= 1 && window.scrollTo(0, document.body.scrollTop - 1);  
  }, 10)

}

But I don't know where in unigui, how to write a code like that.

 

Link to comment
Share on other sites

:o

I added the following code to unimedit's extevents - > bulr to solve this problem temporarily, but I don't know if it's the right way to do it.

setTimeout(() => {
    window.scrollTo(0, document.body.scrollTop + 1);
    document.body.scrollTop >= 1 && window.scrollTo(0, document.body.scrollTop - 1);  
  }, 10)

 

Link to comment
Share on other sites

31 minutes ago, Sherzod said:

Hi,

How should we understand this? Can you expalin in more details?

1. If the operating system is IOS

2. If you use the built-in browser of Wechat

When both situations are satisfied

When input, the node with relative positioning (fixed, absolute: relative to the browser form) will be displaced, resulting in the node click event offset and can not be selected, that is to say, the page can not rebound after the input box loses focus.

Other people's solution is to slide the page again.

I solved the problem by adding the following code to extevents - > blur, imitating the way others did.

setTimeout(() => {
    window.scrollTo(0, document.body.scrollTop + 1);
    document.body.scrollTop >= 1 && window.scrollTo(0, document.body.scrollTop - 1);  
  }, 10)

 

Link to comment
Share on other sites

At the moment, I can not test for the above requirements.

26 minutes ago, powergov said:

unimedit's extevents - > bulr to solve this problem temporarily, but I don't know if it's the right way to do it.

If it works, then of course you can use this event at the moment.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...