0

In react-rails, the onMouseOut event works only if the element is not disabled.

Following is the code in the render method:

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: !@valid()
        onMouseEnter: @showPopOver
        onMouseOut: @hidePopOver
        'Create admin'

The corresponding methods called are shown below:

showPopOver: function() {
  if (!this.valid()) {
    return $('[data-toggle="popover"]').popover('show');
  }
},
hidePopOver: function() {
  return $('[data-toggle="popover"]').popover('destroy');
},
Vipin Verma
  • 5,330
  • 11
  • 50
  • 92

1 Answers1

0

This is how HTML works. No events for disabled elements. You'll have to make it "appear" to be disabled by other means if you want the events to trigger.

Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72