Skip to main content
Inspiring
May 13, 2025 4:56 PM UTC
Answered

Problem with TextImput

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?

    kglad
    kgladCorrect answer
    Community Expert
    May 15, 2025 2:09 AM UTC

    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
    }

    8 replies

    Inspiring
    May 18, 2025 4:41 PM UTC

    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.

    Translate
    kglad
    Community Expert
    Community Expert
    May 14, 2025 2:29 PM UTC

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

    Translate
    Inspiring
    May 14, 2025 3:51 PM UTC

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

    Translate
    kglad
    Community Expert
    Community Expert
    May 14, 2025 3:54 PM UTC

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

    Translate