Skip to content

コントローラをunbindした時に、直接ターゲット指定したイベントハンドラがアンバインドされない場合がある #362

@fukudayasuo

Description

@fukudayasuo

グローバルセレクタでオブジェクトや要素を指定してバインドして、unbind時にバインド対象要素が参照できない時、正しくアンバインドできない。以下のようなコードで動作を確認した。

h5.core.controller('body', {
  __name:'controller',
  target: $('.target'),
  '{this.target} click': function(){
    console.log('binded!');
  }
}).readyPromise.done(function(){
  this.target = null;  // this.targetにnullを代入
  this.unbind();        // unbind
  $('.target').click(); // "binded!"
});

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions