phoenix_live_view 0.18.13 → 0.18.14

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.
@@ -152,7 +152,8 @@ let JS = {
152
152
  if(eventType === "remove"){ return }
153
153
  let onStart = () => {
154
154
  this.addOrRemoveClasses(el, inStartClasses, outClasses.concat(outStartClasses).concat(outEndClasses))
155
- DOM.putSticky(el, "toggle", currentEl => currentEl.style.display = (display || "block"))
155
+ let stickyDisplay = display || this.defaultDisplay(el)
156
+ DOM.putSticky(el, "toggle", currentEl => currentEl.style.display = stickyDisplay)
156
157
  window.requestAnimationFrame(() => {
157
158
  this.addOrRemoveClasses(el, inClasses, [])
158
159
  window.requestAnimationFrame(() => this.addOrRemoveClasses(el, inEndClasses, inStartClasses))
@@ -174,7 +175,8 @@ let JS = {
174
175
  } else {
175
176
  window.requestAnimationFrame(() => {
176
177
  el.dispatchEvent(new Event("phx:show-start"))
177
- DOM.putSticky(el, "toggle", currentEl => currentEl.style.display = display || "block")
178
+ let stickyDisplay = display || this.defaultDisplay(el)
179
+ DOM.putSticky(el, "toggle", currentEl => currentEl.style.display = stickyDisplay)
178
180
  el.dispatchEvent(new Event("phx:show-end"))
179
181
  })
180
182
  }
@@ -225,6 +227,10 @@ let JS = {
225
227
 
226
228
  filterToEls(sourceEl, {to}){
227
229
  return to ? DOM.all(document, to) : [sourceEl]
230
+ },
231
+
232
+ defaultDisplay(el){
233
+ return {tr: "table-row", td: "table-cell"}[el.tagName.toLowerCase()] || "block"
228
234
  }
229
235
  }
230
236
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phoenix_live_view",
3
- "version": "0.18.13",
3
+ "version": "0.18.14",
4
4
  "description": "The Phoenix LiveView JavaScript client.",
5
5
  "license": "MIT",
6
6
  "repository": {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phoenix_live_view",
3
- "version": "0.18.13",
3
+ "version": "0.18.14",
4
4
  "description": "The Phoenix LiveView JavaScript client.",
5
5
  "license": "MIT",
6
6
  "module": "./priv/static/phoenix_live_view.esm.js",
@@ -2310,7 +2310,8 @@ var JS = {
2310
2310
  }
2311
2311
  let onStart = () => {
2312
2312
  this.addOrRemoveClasses(el, inStartClasses, outClasses.concat(outStartClasses).concat(outEndClasses));
2313
- dom_default.putSticky(el, "toggle", (currentEl) => currentEl.style.display = display || "block");
2313
+ let stickyDisplay = display || this.defaultDisplay(el);
2314
+ dom_default.putSticky(el, "toggle", (currentEl) => currentEl.style.display = stickyDisplay);
2314
2315
  window.requestAnimationFrame(() => {
2315
2316
  this.addOrRemoveClasses(el, inClasses, []);
2316
2317
  window.requestAnimationFrame(() => this.addOrRemoveClasses(el, inEndClasses, inStartClasses));
@@ -2332,7 +2333,8 @@ var JS = {
2332
2333
  } else {
2333
2334
  window.requestAnimationFrame(() => {
2334
2335
  el.dispatchEvent(new Event("phx:show-start"));
2335
- dom_default.putSticky(el, "toggle", (currentEl) => currentEl.style.display = display || "block");
2336
+ let stickyDisplay = display || this.defaultDisplay(el);
2337
+ dom_default.putSticky(el, "toggle", (currentEl) => currentEl.style.display = stickyDisplay);
2336
2338
  el.dispatchEvent(new Event("phx:show-end"));
2337
2339
  });
2338
2340
  }
@@ -2377,6 +2379,9 @@ var JS = {
2377
2379
  },
2378
2380
  filterToEls(sourceEl, { to }) {
2379
2381
  return to ? dom_default.all(document, to) : [sourceEl];
2382
+ },
2383
+ defaultDisplay(el) {
2384
+ return { tr: "table-row", td: "table-cell" }[el.tagName.toLowerCase()] || "block";
2380
2385
  }
2381
2386
  };
2382
2387
  var js_default = JS;