Hello everyone,
In my website all text fields are laggy. When you try to type something letters are coming with delay.
I tried these:
-Deleted all the code so if any code causes the lag (Nothing changed)
-Checked all the setting of input field changed required setting etc. (Nothing changed)
-Changed design settings (color, font, etc.) (Nothing changed).
What can I do about it?
My website: https://www.damataxi.com/
As Heath says, it is a common issue with Wix, however to solve it you simply add a setTimeout for each of your onKeyPress user inputs so that it gives the code a delay before it takes the user input value etc.
https://www.wix.com/corvid/forum/community-discussion/give-the-textinput-onkeypress-function-some-time
Give the TextInput onKeyPress Function some time
If you’ve ever inspected the TexInput’s value when the onKeyPress() event handler is triggered, you were probably puzzled by the lack of the last entered character.
Try it yourself with console.log() output - something like this:
export function input1_keyPress(event, $w) {
let val = $w('#input1').value;
console.log(val);
}
The console output will always be one character behind.
So what gives? You just need to wait a bit for the value to be updated. Use setTimeout() to introduce a small delay…