mercredi 13 juin 2018

DOM Traversing Error in Ember.js

I have my template something like this,

<ul id="items">
    
       <li>
        <!-- <input type="checkbox" id= /> -->
        
       </li>
    
</ul>

And I have my js something like this,

import Ember from "ember";

export default Ember.Controller.extend({
  appName: "Ember Twiddle",
  items: [{}],
  init: function() {
    $(document).on("click.somename", function (e) {
      alert($(e.target).parent().length);
    });
  }
});

What happening for my project is that, if I click on ember input helper I am not able to get the parentElement using jQuery. But when I changed that input helper to normal <input type="checkbox" />, I am able to get the parentElement. I don't know whether Ember is using any virtual DOM or something to render its own helpers.

Unfortunately, I am not able to make a fiddle/plunker as the issue is not able to replicate in them. Sorry about that. In my project, I am using ember@2.7.3.

Any suggestions/help on this issue?




Aucun commentaire:

Enregistrer un commentaire