phoenix_live_view 0.18.0 → 0.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -603,7 +603,7 @@ export default class LiveSocket {
603
603
  }
604
604
 
605
605
  bindClicks(){
606
- window.addEventListener("mousedown", e => this.clickStartedAtTarget = e.target)
606
+ window.addEventListener("click", e => this.clickStartedAtTarget = e.target)
607
607
  this.bindClick("click", "click", false)
608
608
  this.bindClick("mousedown", "capture-click", true)
609
609
  }
@@ -36,7 +36,7 @@ export let clone = (obj) => { return JSON.parse(JSON.stringify(obj)) }
36
36
 
37
37
  export let closestPhxBinding = (el, binding, borderEl) => {
38
38
  do {
39
- if(el.matches(`[${binding}]`)){ return el }
39
+ if(el.matches(`[${binding}]`) && !el.disabled){ return el }
40
40
  el = el.parentElement || el.parentNode
41
41
  } while(el !== null && el.nodeType === 1 && !((borderEl && borderEl.isSameNode(el)) || el.matches(PHX_VIEW_SELECTOR)))
42
42
  return null
@@ -110,8 +110,6 @@ export default class View {
110
110
  flash: this.flash,
111
111
  }
112
112
  })
113
- this.showLoader(this.liveSocket.loaderTimeout)
114
- this.bindChannel()
115
113
  }
116
114
 
117
115
  setHref(href){ this.href = href }
@@ -611,6 +609,8 @@ export default class View {
611
609
  joinDead(){ this.isDead = true }
612
610
 
613
611
  join(callback){
612
+ this.showLoader(this.liveSocket.loaderTimeout)
613
+ this.bindChannel()
614
614
  if(this.isMain()){
615
615
  this.stopCallback = this.liveSocket.withPageLoading({to: this.href, kind: "initial"})
616
616
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phoenix_live_view",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "The Phoenix LiveView JavaScript client.",
5
5
  "license": "MIT",
6
6
  "module": "./priv/static/phoenix_live_view.esm.js",
@@ -172,7 +172,7 @@ var clone = (obj) => {
172
172
  };
173
173
  var closestPhxBinding = (el, binding, borderEl) => {
174
174
  do {
175
- if (el.matches(`[${binding}]`)) {
175
+ if (el.matches(`[${binding}]`) && !el.disabled) {
176
176
  return el;
177
177
  }
178
178
  el = el.parentElement || el.parentNode;
@@ -2312,8 +2312,6 @@ var View = class {
2312
2312
  flash: this.flash
2313
2313
  };
2314
2314
  });
2315
- this.showLoader(this.liveSocket.loaderTimeout);
2316
- this.bindChannel();
2317
2315
  }
2318
2316
  setHref(href) {
2319
2317
  this.href = href;
@@ -2776,6 +2774,8 @@ var View = class {
2776
2774
  this.isDead = true;
2777
2775
  }
2778
2776
  join(callback) {
2777
+ this.showLoader(this.liveSocket.loaderTimeout);
2778
+ this.bindChannel();
2779
2779
  if (this.isMain()) {
2780
2780
  this.stopCallback = this.liveSocket.withPageLoading({ to: this.href, kind: "initial" });
2781
2781
  }
@@ -3778,7 +3778,7 @@ var LiveSocket = class {
3778
3778
  }
3779
3779
  }
3780
3780
  bindClicks() {
3781
- window.addEventListener("mousedown", (e) => this.clickStartedAtTarget = e.target);
3781
+ window.addEventListener("click", (e) => this.clickStartedAtTarget = e.target);
3782
3782
  this.bindClick("click", "click", false);
3783
3783
  this.bindClick("mousedown", "capture-click", true);
3784
3784
  }