JedWatson / react-hammerjs

ReactJS / HammerJS integration. Support touch events in your React app.
MIT License
937 stars 129 forks source link

onPress not fired #63

Closed pimkle closed 7 years ago

pimkle commented 7 years ago

below is the code I'm currently using, onPress seems not fired. when I change onPress to onPan, everything works fine. Is that a bug?

`

        <Hammer onSwipe={this.onSwipe}>  
            <div className="flex-column">  
                <div className="txt-ctrl">当前房间<br/><br/>xxxx 5幢 0602室 <em className="icon_down"></em></div>  
                <div className="flex2"></div>  
                <div className="ctrl-name">大门</div>  
                <Hammer className="btn-wrapper" onPress={this.onPress}>  
                    <div>  
                        <div id="v_locked" className="loc-wrapper locked"></div>  
                        <div id="v_finger" className="loc-wrapper finger hide">  
                            <img className="img_fingerprint" src="img/touch.gif" alt=""/>  
                        </div>  
                    </div>  
                </Hammer>  
                <div className="ctrl-name-small">长按1秒开锁</div>  
                <div className="flex1"></div>  
                <div className="flex1"></div>  
            </div>  
        </Hammer>

`

pimkle commented 7 years ago

My fault, onPress is not triggered on chrome developer, it IS fired on phones.