Hi there I’d replace the flex cable, and maybe the button too just for the sake of ruling out both.
A new flex should fix it though. If it doesn’t then maybe water got somewhere else also.
Main priority flex cable before anything else.
Also check screen frame isn’t bent near it causing it to play up when in place or snagging it up. Still replace it though even if it’s the frame, unless it fixes the issue of course.