does anyone know of something in hoplon that changes the way that NodeList
works?
hmmm
(defn- set-insertBefore!
[this kidfn]
(set! (.-insertBefore this)
(fn [x y]
(this-as this
(with-let [x x]
(ensure-kids! this)
(cond
(not y) (swap! (kidfn this) conj x)
(not= x y) (swap! (kidfn this) #(vec (mapcat (fn [z] (if (= z y) [x z] [z])) %)))))))))
this looks suspicious, and probably is breaking the editor
@micha @alandipert could i get a little help/advice on this?
i think that https://github.com/ckeditor/ckeditor5-utils/blob/7dab8907b37764bc1a477f07c7e30e8bad6fe836/src/dom/insertat.js#L17 is being broken by https://github.com/hoplon/hoplon/blob/master/src/hoplon/core.cljs#L211
i might be getting a bit beyond my understanding of hoplon internals here
why do we need to override low level fns like insertBefore
? and why not wrap default functionality instead of replacing it?
looks like set-appendChild!
has explicit handling for native?
elements with a fallback to the native fn, but removeChild
, insertBefore
, replaceChild
, setAttribute
have no native element handling
and setAttribute
is not added to the prototype, but the others are
thedavidmeister it sounds likely to me, your theory that the patched nodes are the problem
thedavidmeister are you passing an element you created with a hoplon.core constructor function to ckeditor? the workaround would be to pass it an element you created yourself with document.createElement
@alandipert do you recall why we override the low level function?
@thedavidmeister maybe comment out all the overrides and see what breaks?