Never tried, but let me know how and I can give it a shot.
in /etc/systemd/logind.conf:
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
Then: systemctl restart systemd-logind
In addition, some desktop environments may also trigger suspend. If so, there should be options in the power settings menu.