uzairfarooq / arrive

Watch for DOM elements creation and removal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] Option to watch for text change

narcolepticinsomniac opened this issue · comments

Doesn't appear to be something you've added support for, unless I'm missing something.

2pl5gp

This could be heavy on performance but I guess still good to have if anyone wants to use it. I imagine something similar to jQuery's :contains selector:

document.arrive('.elem:contains(Hello)', (e) => {
  console.log(e);
});

Note: We don't use jQuery in the library so :contains have to be custom implemented.

.elem:contains(Hello)

Pretty sure this was exactly the use case I was referring to at the time. I've since quit using jQuery, in favor of writing my own terrible js.

Custom :contains would work, but might be confusing, given that it's heavily associated with jQuery. Either way, the goal would be to enable something like fireOnCharacterDataModification.

This isn't something I've experimented with since the OP while using arrive, so if it's already capable of firing on text change, it's a non-issue. If not, it would be a solid feature. =)