You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm really struggling to get insertBefore to work properly with cells (cells are the only reason to introduce the prototype overrides AFAICS).
Here's a few confusing examples:
Two cells provided for x and y.
(let [parent (h/div)
x (j/cell"foo")
y (j/cell"bar")]
(is (= y (.appendChild parent y)))
(is (= x (.insertBefore parent x y))) ; <-- seems to do nothing
(is (="foobar" (.-textContent parent))))) ; <-- actually "bar"
Mixing cells with divs.
(let [parent (h/div)
x (j/cell"foo")
y (h/div"bar")]
(is (= y (.appendChild parent y)))
(is (= x (.insertBefore parent x y))) ; <-- throws #object[Object Error: NotFoundError: DOM Exception 8]
(is (="foobar" (.-textContent parent))))) ; <-- actually "bar"
(let [parent (h/div)
x (h/div"foo")
y (j/cell"bar")]
(is (= y (.appendChild parent y)))
(is (= x (.insertBefore parent x y))) ; <-- no error this time, fails silently
(is (="foobar" (.-textContent parent))))) ; <-- actually "bar"
i also couldn't see anywhere in hoplon that the managed insert logic is actually used.
are we overriding the prototype for no reason here?
how is this supposed to work?
The text was updated successfully, but these errors were encountered:
thedavidmeister
changed the title
multiple issues with managed insertBefore
multiple issues with managed insertBefore and replaceChild for cells
Dec 23, 2017
I'm really struggling to get
insertBefore
to work properly with cells (cells are the only reason to introduce the prototype overrides AFAICS).Here's a few confusing examples:
Two cells provided for x and y.
Mixing cells with divs.
i also couldn't see anywhere in hoplon that the managed insert logic is actually used.
are we overriding the prototype for no reason here?
how is this supposed to work?
first noticed as part of testing at #205
The text was updated successfully, but these errors were encountered: