0

在react-rails中,onMouseOut事件仅在未禁用元素时才起作用。为html中禁用的元素启用onMouseOut

以下是在渲染方法的代码:

dom.button 
     type: 'submit' 
     'data-toggle': "popover" 
     title: "Form Requirements" 
     'data-content': 'Please fill in all the form fields before submitting this form' 
     'data-placement': "bottom" 
     className: 'btn btn-primary' 
     disabled: [email protected]() 
     onMouseEnter: @showPopOver 
     onMouseOut: @hidePopOver 
     'Create admin' 

相应的方法称为如下所示:

showPopOver: function() { 
    if (!this.valid()) { 
    return $('[data-toggle="popover"]').popover('show'); 
    } 
}, 
hidePopOver: function() { 
    return $('[data-toggle="popover"]').popover('destroy'); 
}, 

回答

0

这是HTML是如何工作的。没有禁用事件的元素。如果您希望触发事件,则必须使其“出现”才能通过其他方式禁用。

+0

但onMouseEnter事件工作,那么为什么onMouseOut不。并且这个事件在Firefox上运行 – vipin8169