Sounds like you've gotten a short in the switch wiring or possibly at the motor.(if it is electric)
I would think this would run the battery down completely. Unless it blew a fuse or circuit breaker.
I think I would disconnect the battery at the terminal. The disconnect switch sometimes doesn't disconnect everything on all RVs. Then hand crank the slide back in.
Sounds like either the slide circuit breaker or the battery aren't working. If it's the slide circuit breaker consider yourself lucky. If not you'll probably have to replace the battery if the short maintained a load for some time.
You'll then have to troubleshoot the cause of the anomaly.
I was assuming your slide was electric.
I had a hydraulic slide with double cylinders that would extend by itself only on one end. Turned out that only one cylinder had a bypass valve. Small temperature changes (hydraulic fluid expansion) while driving down the road would push the un-bypassed ram out but would not retract. Actually had to bleed the fluid off and push the slide in. I didn't figure this out on my own. An un-named manager that worked for the RV manufacture told me how to fix it.