question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing Elements/Nodes Asynchronously(?)

See original GitHub issue

Here’s a fiddle to illustrate my use case: https://jsfiddle.net/dylanrw/mcg324a4/

Typically there isn’t a problem, if state changes, I want the irrelevant elements removed. But when it comes to animating elements before removal, it would be nice if I could begin a transition and have the removal/sorting process occur once that transition is completed, or do something to have the soon-to-be-removed element stay in place until the transition is complete (even if the other elements update). (As you see in the fiddle, if you click an element, the elements are sorted, and then the element clicked is removed at the bottom.)

I tried one experiment at @jbucaran’s encouragement where I added a lifecycle event onreorder, and I noticed that I got the results I was after by skipping the element.insertBefore in app.js#265. I wonder if something like a noreorder node attribute that does similar would work?

Thanks in advance to @jbucaran and @zaceno for their collective patience!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
jorgebucarancommented, Jul 24, 2017

componentWillReceiveProps looks very similar to what @zaceno and I were talking about to do about #313, that is, to introduce a new lifecycle event: onpatch. šŸ¤”

0reactions
dylancommented, Jul 24, 2017

You can’t expect issues to be resolved in a couple of days. FYI, issues are sometimes open for longer than 3 days before anything actionable can happen.

Hopefully you didn’t consider my ā€œwaste of timeā€ comment sarcasm or a snide remark about responsiveness, my initial writeup/problem/goals are just fuzzy enough that I was self conscious about my taking up you guys’ time.

In the future I won’t close any issues.

P.S: Also, it’s not up to you to decide if you are wasting my time or not. AFIC you are/were not wasting my time. šŸ˜‰

Cool, reopen the issue if you want.

Slightly back on topic however, something like react’s componentWillReceiveProps may allow me to pull off what I was originally after, but I need to rethink how I’m approaching the problem with Hyper to better articulate things.

Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Asynchronously remove children of a DOM element?
What is the best way to remove all children of the parent node -- preferably asynchronously or through a separate process? Here are...
Read more >
Traversing and Removing Nodes - Beginner JavaScript
In this video, we will learn about traversing through our DOM element and removing elements from the DOM. Create a file name traversing.js...
Read more >
How to Remove a DOM Element in JavaScript
Summary: in this tutorial, you'll learn how to remove an element from the DOM using the removeChild() and remove() method.
Read more >
How to Create and Remove Elements Using JavaScript
If you want to remove an element from the document, you can use the remove() method. The remove() method removes a specified child...
Read more >
Remove DOM elements - Dart programming language
Use element.remove() to remove an element from the DOM. Ā· Remove all children from an element with element.children.clear() . Ā· Function expressions are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found