platform icon indicating copy to clipboard operation
platform copied to clipboard

Wildcard selector for listener.

Open HichemBenali opened this issue 3 years ago • 3 comments

Proposed Changes

  • Added wildcard to the listener allowing the usage of Listener with Matrix.

HichemBenali avatar Jun 18 '22 18:06 HichemBenali

Hi @HichemBenali, But after all, this will only work for matrix rows that already existed, but were not added, due to the fact that the event is only registered when the page is loaded?

tabuna avatar Jun 19 '22 02:06 tabuna

Hi @tabuna you are correct, I forgot that aspect. I believe this can be solved by either attaching a MutationObserver to the matrix table or by adding a custom event to the matrix it self then listening for that event.

HichemBenali avatar Jun 19 '22 10:06 HichemBenali

@tabuna

Updated Proposal.

  • Added wildcard to the listener allowing the usage of Listener with Matrix.
  • Added MutationObserver to automatically add event listeners to newly added matrix fields.

HichemBenali avatar Jun 21 '22 14:06 HichemBenali