The applet keyboard blocks the bottom input box resolution

**

At the bottom is a single line input box:

**
Because it is a line input box, you can use the cursor-spacing (the distance from the cursor to the keyboard) that comes with the small program component to set the distance between the input box and the keyboard.Insert picture description here

**

At the bottom is a multi-line input box textarea

**
Question-solving idea: the input box will be blocked by the keyboard because the height of the input box is not as high as the keyboard height. You can set the distance between the input box and the bottom to the height of the keyboard

  1. Write the style and increase the padding / height between the input box and the bottom when it is determined that the input box has the focus;
  2. The bindfocus event can get the height of the keyboard, e.detail.height
    Note: Because the editor on the PC side does not have a keyboard, you can debug it when previewing on the phone, you can see this parameter
  3. When the focus is lost, restore the distance set in the first step to 0;Insert picture description here

The legacy of italic style: what is the difference between focus='{ {focus}}' and focus='focus'

Guess you like

Origin blog.csdn.net/jiaodeqiangs/article/details/102605532