My iPhone X screen has been malfunctioning for several months. It would swipe, tap, and type without any understandable cause. I went ahead and decided to get someone to fix it. They changed the screen but the replacement screen wasn't working properly; touches would do nothing even when everything was rendering. The repair service guy, with my phone half open, told me he had to put my phone back as it was, even taking out the new battery he had just installed and putting back in my old one. The result was that now my old screen is working normally, which may mean the screen wasn't broken but misplaced. It may have shifted slightly due to the phone falling and simply disassembling the phone and putting it back together may have fixed those issues.
The swipes and taps would drain the battery as this would happen even when the phone was locked. I'm not sure if you can imagine how bad the experience of using this phone was. What kept me using this phone was that this wasn't a persistent error but an issue that would only express itself at random. I was never able to figure out what was causing the issue.
I'm supposed to go back to replace my battery and screen when a new replacement piece is available at the store. But now I think I'm good with my iPhone as it is.