Skip to main content
Inspiring
May 13, 2025
Answered

Problem with TextImput

  • May 13, 2025
  • 2 replies
  • 577 views

Hello, Using the "TextImput" component, the console displays: "Adding a listener for DOMNodeRemoved is deprecated and will soon be removed. Instead of MutationEvent, use MutationObserver. https://developer.mozilla.org/docs/Web/API/MutationObserver." How do I resolve this issue?

    Correct answer kglad

    Yes.


    then use:

     

    // create and add input tf

    const inputElement = document.createElement("input");
    inputElement.type = "text";
    inputElement.placeholder = "Enter text here";
    document.body.appendChild(inputElement);
     
    // detect when text changes
    inputElement.addEventListener("input", changeF);
    function changeF(e){
    alert(e.target.value);  // <-do whatever with the input
    }

    2 replies

    Inspiring
    May 18, 2025

    You can also go into the file anwidget.js and comment out the offending code:

    //            $(parent).bind("DOMNodeRemoved", function(e) {
    //                $this.destroy();
    //            });

     The destroy method, in the prototype, does nothing except add unneeded eventlisteners to the DOM. It calls "delete this" which does not actually free up the object. JS will free up the object when it falls out of scope. None of the provided components override it either so it is safe to remove.

    kglad
    Community Expert
    Community Expert
    May 14, 2025

    don't use a textinput component.  except for the styling it doesn't offer anything over an input textfield.

    Inspiring
    May 14, 2025

    Is there another way to enter numbers into an animation? And then use them for calculations?

    kglad
    Community Expert
    Community Expert
    May 14, 2025

    oh wait, is this a html5 app you're making?