表情符号选择器搜索性能

I gave that a try out of curiosity and, indeed, I can reproduce the issue in Chrome with CPU throttling as @david mentioned. For me, replacing this line:

With:

this.$list.css('visibility', 'hidden');

That fixed the problem for me. I know that visibility: hidden is more performant than display: none because it won’t cause a reflow, but no idea about why that is having such impact here (maybe this old chrome bug is still around?). Also, I don’t know if the visibility: hidden will introduce other unwanted side effects, but seems to work fine.

It was not a JQuery’s hide() thing. this.$list.css('display', 'none') was as slow as this.$list.hide().

10 个赞