bigskysoftware / idiomorph

A DOM-merging algorithm
BSD 2-Clause "Simplified" License
641 stars 32 forks source link

Return false from callbacks to prevent default behavior #6

Closed davidalejandroaguilar closed 1 year ago

davidalejandroaguilar commented 1 year ago

This adds the possibility of stopping a behavior from a callback if it returns false, as it's done on morphdom.

1cg commented 1 year ago

Hi david,

Looks good, would you mind adding some tests for the change?

davidalejandroaguilar commented 1 year ago

@1cg My bad, didn't notice we had a tests folder, I'll add them.

1cg commented 1 year ago

hey @davidalejandroaguilar just checking in on this, would like to merge w/ some tests

tobyzerner commented 1 year ago

Looking forward to this being merged - in my case, idiomorph is trying to merge <svg> child elements where I just want the entire new <svg> to overwrite the old.

1cg commented 1 year ago

OK, merging w/o tests. I will add some later. (lol)

daun commented 10 months ago

This looks fantastic! @1cg Any chance this could be released? As far as I can tell, the current release on npm doesn't include the changes from this PR.

1cg commented 10 months ago

i will try to cut a release tomorrow

daun commented 10 months ago

🤠

1cg commented 10 months ago

should be available in the latest release on NPM

davidalejandroaguilar commented 7 months ago

I just noticed I abandoned this PR 🤦🏼‍♂️ . My apologies @1cg, life got in the way but absolutely didn't mean to ghost you.

Thank you for merging!