Hello everybody
My job is iphone and macbook repair And it happen to me yesterday and there was no solution in internet.
If you didnt repair your home button or screen before, its a software problem.
I had this problem while charging in ios11.
In ios11 we have a new shutdown in setting/general
Its not like holding wake/sleep button and slide to power off.
This problem in ios11 will be fixed just by this way:
Setting-> general-> shutdown-> slide to power off
And turn it on after that.
Its worked for me and one of my costumers.
Kevin