(I just realized that "flexible" above might be interpreted positively, like "applicable in more situations". No, I mean "flexible" as in "may not be satisfactorily used as a bridge over a pothole in case of emergency", which the original would be able to pull off and still be used to write a blog post about the experience afterward.)
I have not personally done this, but google "ibm model m dishwasher" and you'll see lots of anecdotes.
Should work perfectly in the morning.
be careful of what soap you use though, dishwasher soap is too harsh. Manufactures are using deionized water and if any soap it is specific to electronics. Your house water isn't pure enough to do this often but once ever few years and you will normally get away with it.
LCDs are definitely not sealed enough, many capacitors are electrolytic, and fiberglass is not impermeable to water (in fact, water-logged fiberglass is an issue for boats in areas where weather causes freeze-thaw cycles.)
Your dishwasher is full of mineral deposits, food waste particles, and likely quite a bit of mold. Getting rid of all of that would involve dissolving deposits with vinegar or citric acid, then running some lye or similarly aggressive treatment to get the mold and organic waste out. That's a lot of hassle.
You can't put "soap" in a dishwasher unless you want a giant bubble factory. So now you're looking at trying to find a specialty cleaner.
Most people's water is not nearly pure enough for the keyboard to not have issues afterward. You MIGHT get away with it if you thoroughly blasted it with compressed air and then dunked it in distilled water.
That's a huge amount of hassle.
Unless something has been spilled on the keyboard, just periodically brush out debris and then hit it with compressed air...
That reminds me that once as a kid I got a free Apple II+ and the main board was really dusty. So, like any enterprising kid I unconnected and unscrewed it, washed it in the sink with soap and water, and then set it in the oven at 250F to dry for a few hours. It worked great! I wonder how many modern consumer products could take that same abuse?