Skip to content

Commit

Permalink
IE needs an element to be added to the document before it will call e…
Browse files Browse the repository at this point in the history
…vent handlers.
  • Loading branch information
mbest committed Aug 28, 2015
1 parent 4bfa0b8 commit aae6bf0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/utilsDomBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe('setTextContent', function () {
});

describe('registerEventHandler', function() {
beforeEach(jasmine.prepareTestNode);

it ('if jQuery is referenced, should use jQuery eventing with useOnlyNativeEvents option set to false', function() {
if (typeof jQuery === 'undefined') {
return; // Nothing to test. Run the specs with jQuery referenced for this to do anything.
Expand All @@ -42,6 +44,8 @@ describe('registerEventHandler', function() {
var eventFired = false;
var jQueryModified = false;

testNode.appendChild(element);

// Set the option to true.
ko.options.useOnlyNativeEvents = false;

Expand All @@ -68,6 +72,8 @@ describe('registerEventHandler', function() {
var eventFired = false;
var jQueryModified = false;

testNode.appendChild(element);

// Set the option to true.
ko.options.useOnlyNativeEvents = true;

Expand Down

0 comments on commit aae6bf0

Please sign in to comment.