Unfortunately, the only way to prevent this from happening is by *not* moving the mouse out of the editor area when panning.
When you drag the mouse out of the editor area, yEd (erroneously) always assumes you are (left) dragging one or more nodes and switches to behavior that is appropriate for dragging nodes.
We will improve this behavior in an upcoming version.