Three.js set camera and rotation programmatically when using OrbitControl

I use the OrbitControl on my project, and thought to add the ability to rotate and change the position of the camera using form input. But I am encountering some issues.

I added an event listener to the input which triggers an event when the user changes the value of the input.

setPositionByInput(x, y, z){
    camera.position.x = x
    camera.position.y = t
    camera.position.z = z
}

After calling this method I call the Three.ja function which renders again the object.

The function works fine, but when trying to move the Three.js object using the OrbitControl the position changed automatically to the position was before running the function above.