title: AgGridReact stop editing and restore old value
body: <p>I have a react component with an <code>AgGridReact</code> which has an editable column. I want inside the <code>onCellValueChanged</code> event to check if the new value meets some conditions, and if not stop and restore the old value.</p>
  <p>I've read that there is an api <code>stopEditing</code>:</p>
  <p><a href="https://www.ag-grid.com/documentation/javascript/cell-editing/#editing-api" rel="nofollow noreferrer">https://www.ag-grid.com/documentation/javascript/cell-editing/#editing-api</a></p>
  <p>Here it says:</p>
  <p>&quot;stopEditing(cancel): If the grid is editing then editing is stopped. Passing cancel=true will keep the cell's original value and passing cancel=false will take the latest value from the cell editor.&quot;</p>
  <p>So I've tried using it. Just to test it out I did like this:</p>
  <pre><code>const onGridReady = params =&gt; 
  {
    gridApi.current = params.api;
  }
  
  const onCellValueChanged = async (event) =&gt; 
  {
    gridApi.current.stopEditing(true);
    return;
  }
  </code></pre>
  <p>I expected that every time I'll try to edit, no matter what, as soon as I click enter to finish editing, the old value will be restored but it just keeps the new value. The event itself is set properly and it is being invoked.</p>
  <p>What am I doing wrong here? And if it's not the way to restore the previous value, what is?</p>