JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app>
  <h2>Issue with DOM updates</h2>    
  <div ng-controller="MyController">
      <h3>Counter: {{counter}}</h3>
      <p><b>Explanation of the problem:</b> Try to select the line bellow, after 1 second or less, the selection will be undone. Although the array content is not changed, the AngularJS is updating the DOM, and the selection is being undone. It's not always good, suppose that the element is a button. If the DOM is updated at the same time that the user clicked in the button, there will be loss of the onclick event. My question is: <b>how to avoid it</b>?</p>
      <ul>
          <li ng-repeat="d in dataArray track by d.name">
              Name: {{d.name}}
          </li>
      </ul>
  </div>
</div>

JavaScript

function MyController ($scope, $timeout) {
    
    // This is a simple counter, just to see that the screen is being updated.
    $scope.counter = 0;
    
    $scope.dataArray = [{name: 'Alexandre Verri'}];
   
    // This is a poll function, that will be called one time per second.
    var poll = function () {
        $timeout(function () {
            // Just increment the counter, not relevant...
            $scope.counter++;
            // Update the array, with the same content.
            $scope.dataArray = [{name: 'Alexandre Verri'}];
            poll();
        }, 1000);
         
    };
    
    // Start the poll timer.
    poll();
}