OnePlus devices are known for being among the top devices in terms of their battery life, efficiency and optimization of the operating system. After the latest update pushed by OnePlus team to fix some bugs many users started complaining on worsening device battery life. My current latest setup of my OnePlus 5 device is OxygenOS 5.1.4 on Android 8.1.0 and here is the trick to extend your device battery life and to prevent charge draining.
1. Open phone setting, scroll down to Battery and open Battery menu