我是新的反应-测试-库/玩笑,并试图写一个测试,看看导航的路由(使用反应路由器-多玛)是否正确执行。到目前为止,我一直在关注如何使用和这个。我的一个组件在本地函数中使用scrollIntoView,这会导致测试失败。TypeError: this.messagesEnd.scrollIntoView is not a function
46 | scrollToBottom = () =^ 49 |
我实现scrollIntoView只是为了在事件发生时滚动到一个元素,它在web浏览器中工作得很好,但是当在ios模拟器中测试它时,它会抛出这个错误,在react上有什么替代scrollIntoView错误:
TypeError: inputRefs[propertyName].scrollIntoView is not a function.(In 'inputRefs[propertyName].scrollIntoView</e
我正在寻找一种方法来对我的用户浏览器的scrollIntoView功能进行实时测试。这不是一个"“检查;相反,我希望有优雅的降级。我正在使用jQuery,如果preventDefault()是可用的,那么希望使用scrollIntoView。.text('scrollIntoView is available'); $('#result').text('scrollIntoViewis n