TextField.setValue resulting in endless loop

I have a TextField that modifies the value in the valueChangeListener using setValue. In some circumstances (only on mac) this results in an endless loop. In others (PC) this works fine: triggering again the valueChangeListener for the new value and since that is not modified again no endless loop.
Before digging into debugger on mac I wanted to ask if it is good practice to programmatically change the value in the valueChangeListener using setValue. In the past there was something like setInternalValue or setValue(X, false) indicating that the change does not come from the client.

The event object has an isFromClient property you can check