Fork me on GitHub
#hoplon
<
2017-12-21
>
thedavidmeister06:12:44

does anyone know of something in hoplon that changes the way that NodeList works?

thedavidmeister06:12:22

(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])) %)))))))))

thedavidmeister06:12:33

this looks suspicious, and probably is breaking the editor

thedavidmeister06:12:33

@micha @alandipert could i get a little help/advice on this?

thedavidmeister06:12:55

i might be getting a bit beyond my understanding of hoplon internals here

thedavidmeister06:12:36

why do we need to override low level fns like insertBefore? and why not wrap default functionality instead of replacing it?

thedavidmeister08:12:14

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

thedavidmeister08:12:43

and setAttribute is not added to the prototype, but the others are

alandipert15:12:01

thedavidmeister it sounds likely to me, your theory that the patched nodes are the problem

alandipert15:12:46

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

flyboarder19:12:10

@alandipert do you recall why we override the low level function?

flyboarder19:12:27

@thedavidmeister maybe comment out all the overrides and see what breaks?