onInput performance ( even crash browser )
See original GitHub issueHi, I am using onInput for my input field. here’s the emitter:
emitter.on('inputUsername', (e) => {
let input = e.target.value
if(input.length < 9){
if(input === '' || input.match(/^[a-z0-9]+$/i)){
state.input.username = input.toLowerCase()
emitter.emit('render')
}
else{
state.input.username = input.slice(0, input.length - 1)
emitter.emit('render')
}
}
else{
emitter.emit('render')
}
})
While typing a lot of characters, for example a,b,c,backspace,backspace,d,e, etc will crash the browser ( google chrome in my case ). After a bit of research, the google chrome dump is telling me that the browser ran out of memory.
Also, while testing on my mobile devices the browser doesnt crash but the performance is so bad. After I press a character in the keyboard, the dom need about .3s - .5s to rerender it.
Is there any solution? I need to make sure the username field less than 9 chars and alphanumeric only.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
240757 - Setting CSS style on INPUT elements causes crash when ...
If the textbox already has text in it (value="a"), all the user has to do is click in the field to cause the...
Read more >353691 - oninput doesn't fire when field is changed by autofill
Issue 353691: oninput doesn't fire when field is changed by autofill. This issue has been migrated to Launch, see link in final comment...
Read more >[#ZBX-21949] List with too many macros affecting browser ...
List with too many macros affecting browser performance ... and host macros" button (higher values even crash the page just by clicking on...
Read more >Lots of crash fixes – Vivaldi Browser snapshot 2643.3
Today's snapshot includes a bunch of fixes for common crashes, a (minor) Chromium and lots of other small improvements.
Read more >Dying, fast and slow: out-of-memory crashes in Python
Sometimes if you're lucky you might even get a nice traceback, ... lot of memory: a browser, an IDE, the program you're testing,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh; glad to hear it’s not us! — if you ever run into more slowdowns (especially with long lists), we now have an issue to handle that! https://github.com/choojs/nanomorph/issues/85
On Wed, Oct 11, 2017 at 8:24 AM Rahmat Albariqi notifications@github.com wrote:
Perhaps we could figure out if there is something going on between choo and jss.