This option worked me for everyone.
I believe the problem is related to "Screen Refreshing" whereby Windows redraws the sync "Icon Overlays" on the desktop (little green tick marks, brown boxes, clouds etc) in the corner of Icons on the Desktop, or in the Navigation Pane in File Explorer. Related to the way File Explorer interacts with any file syncing apps (not just OneDrive) and screen refreshing.
If you go into File Explorer, select the Desktop folder and under Options/View, turn off "Show Sync Provider Notifications" and also turn off "Always Show Availability Status". This should significantly reduce the problem. The problem may still occur if you are renaming multiple files and you select part of the next filename quickly after already having renaming one. In this case the selection might still default back to the full filename once, but it won't keep re-selecting the full filename. May also occur if someone else is updating files in the same folder you're renaming files in.
I have been struggling with this issue for many years, and it has annoyed me tremendously. I had this issue under Windows 10 and now under Windows 11. But finally it is fixed! :-)
Thank you very much, @always_type_A, for providing the solution! Disabling the checkbox "Show Sync Provider Notifications" was indeed the solution.
I had tried all the other solutions in this thread, but none of them worked. Your solution did!
Thank you so much for this!!!