Skip to content

Commit

Permalink
Merge pull request #119 from crixx/bugfix/rootElementResolution-leads…
Browse files Browse the repository at this point in the history
…-to-memory-leak-fix

bugfix(rootElementResolution): fixes #118 wrong resolution of rootElement
  • Loading branch information
runspired authored Oct 2, 2018
2 parents 1e3c93e + 5a6d7a9 commit 1054cc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon/event_dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { getOwner } from '@ember/application';
import { merge, assign as _assign } from '@ember/polyfills';
import { get } from '@ember/object';
import { get, set } from '@ember/object';
import Ember from 'ember';
import defaultHammerEvents from './hammer-events';
import dasherizedToCamel from './utils/string/dasherized-to-camel';
import mobileDetection from './utils/is-mobile';
import { isNone } from '@ember/utils';

const {
EventDispatcher,
Expand Down Expand Up @@ -159,6 +160,10 @@ export default EventDispatcher.extend({
let additionalEvents = assign({}, addedEvents);
additionalEvents = assign(additionalEvents, this.get('_gestures'));

if (!isNone(rootElement)) {
set(this, 'rootElement', rootElement);
}

this._fastFocus();

return this._super(additionalEvents, rootElement);
Expand Down

0 comments on commit 1054cc4

Please sign in to comment.