Solve the problem that only part of the grid is displayed when antd-mobile displays the chat emoji list

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 resizeevent 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)
    }
}

 

Guess you like

Origin blog.csdn.net/a1059526327/article/details/107007202