Some (many?) Google Nexus 5X units have touchscreen issues when charging
According to discussions over at the Google Nexus Help Forums, Reddit and XDA, it seems that the problem isn't the touchscreen itself, but the fact that the charger that the Nexus 5X comes with has a plastic-made grounding pin, instead of a metal-made one.
When the 5X is charged with a USB Type-A to USB Type-C charger, everything works fine (however, in this case, the handset won't be charged as fast as with a genuine USB Type-C cable).
It appears that most of the Nexus 5X units affected by the problem are manufactured in September, though some owners of units manufactured in October are also complaining about this. You can check the month when your Nexus 5X was manufactured by looking at its retail box and searching for the serial number (S/N): if it starts with 509 it means it's from September, 510 means it's from October, and 511 means it's from November (obviously, 5 is the manufacturing year - 2015 - while the other two digits represent the month).
We must mention that we haven't noticed any issues related to touchscreen responsiveness when charging our own Google Nexus 5X, which is manufactured in October. Do you have a Nexus 5X? If yes, have you encountered any problems when charging it with the original charger?
sources: Google Nexus Help Forums (1, 2), Reddit, XDA Forums