Truck cuts out at idle

My 1995 chevy c1500 cuts out at idle or the moment the brakes are apllied to shift into drive. I replaced the passenger wheel cylinder and bled the brakes and it ran fine for a few hours, then the idle problem stated again. I have check the map senor and a few other electronic component as my mechanic said the problem " might be electrical." Any help would be greatly appreciated.

Keep it simple, at least in the beginning

Clean the throttle body
Clean the idle air control valve

If that doesn’t help, the idle air control valve itself may be faulty. That would be fairly common

Do you have any vacuum leaks that you know about?

I don’t believe their are any vacuum leaks however I read that you can simple unplug the iac valve and the throttle position sensor and the idle would change if they were faulty

You can unplug the map and it will run in open loop. That would eliminate that.

I have tried unplugging the map sensor and the idle did not change. I also verified that the map sensor is functioning properly using a voltmeter.

The engine is idling fine, then you press on the brake pedal and it stalls? Make sure you don’t have a problematic brake booster. If the diaphragm springs a leak, it could cause this symptom. In some cases brake fluid gets into that area and pressing on the brakes causes brake fluid to be inhaled into the intake manifold, which could easily stall the engine. Even if no brake fluid is getting through, extra air getting through could lean out the mixture enough to create a stall.

I ran unplugged the map sensor the engine coolant temperature sensor and throttle position sensor and the idle is no longer iritic. The vehicle still stalls when the brakes are applied I believe the booster is the problem. Thank for all the help.