鍍金池/ 問答/HTML/ Popover組件,ios上點(diǎn)擊遮罩層不能關(guān)閉氣泡,安卓上測可以

Popover組件,ios上點(diǎn)擊遮罩層不能關(guān)閉氣泡,安卓上測可以

antd里的Popover組件,ios上點(diǎn)擊遮罩層不能關(guān)閉氣泡,目前安卓上測試可以,為了兼容ios難道只有手寫氣泡組件嗎...多麻煩啊



const Item = Popover.Item;

class More extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            visible: false,
            selected: '',
        };
    };

    onSelect = (opt) => {
        this.setState({
            visible: false,
            selected: opt.props.value,
        });
        if (opt.props.value == '') {
            ///
        } else if (opt.props.value == '') {
            ///
        }
    };

    handleVisibleChange = (visible) => {
        this.setState({
            visible,
        });
    };

    render() {
        let offsetX = -((document.querySelector('body').offsetWidth) * 0.125) + 9;
        return (
            <div>
                <Popover 
                    mask
                    overlayClassName="fortest"
                    overlayStyle={{ color: 'currentColor' }}
                    visible={this.state.visible}
                    className="c-more"
                    overlay={[
                        (<Item key="4" value="code" icon={<Icon type={require('./image/QrCode1.svg')} size="xs" />} data-seed="logId">
                            二維碼
                        </Item>),
                        (<Item key="6" value="quit" icon={<Icon type={require('./image/PullOut1.svg')} size="xs" />}> 
                            <span style={{ marginRight: 5 }}>退出</span>
                        </Item>),
                    ]}
                    align={{
                        overflow: { adjustY: 100, adjustX: 0 },
                        offset: [offsetX, -180],
                    }}
                    onVisibleChange={this.handleVisibleChange}
                    onSelect={this.onSelect}
                >
                    <div className="c-more-button"
                        icon={<Icon type={require('./image/more1.svg')} size="md" />}
                    >
                    </div>
                </Popover>
            </div>
        );
    }
}
回答
編輯回答
失魂人

代碼看不出什么問題。
今天官網(wǎng)確實(shí)打不開,需要梯子才可以。
給你一個(gè)國內(nèi)鏡像:
antd
antd-mobile

2018年8月24日 05:00