The dropdown should close, but it doesn't.

Modals like the "canned replies" automatically closes by design, without any JavaScript. table-input should be modified so it natively closes like the rest of the modals, it should probably never be explicitly closed via JS.
I may be wrong, but I remember it working as supposed to when the feature was first added. It was probably broken by GH updates. I'll take a look at it.
Seems like adding a tooltip on the button disrupts the modal functionality. The "canned replies" input also doesn't have a tooltip, so my guess is that GitHub doesn't implement this in the first place.
I tried a few things, including moving the tooltip to the <details> element itself, to no avail. Unless someone more familiar with the GitHub DOM has a solution, we'll just have to drop the tooltip. It's not perfect, but imo having a functioning modal is more important than having a tooltip.
Seems like adding a tooltip on the button disrupts the modal functionality
You're right, that's because both use :before.
It won't be _accessible,_ but we can wrap the SVG in a div with the tooltip attribute. Better than nothing at all.