When writing the chat emoticon grid, you need to click the emoticon to load the emoticon grid from below, but each click will only load a part of it. After querying, an resize
event must be asynchronously distributed for the window to display it completely
toggleShow = () => {
const isEmojisShow = !this.state.isEmojisShow
this.setState({
isEmojisShow
})
if (isEmojisShow) {
//异步派发resize事件,解决表情列表显示的bug
setTimeout(() => {
window.dispatchEvent(new Event('resize'))
}, 0)
}
}