This is probably a super edge case, but there's a possible out-of-order condition, where a dialog could pop up another dialog (e.g. an alert dialog) during the first dialog's dismiss-button-handler (in the non-autodismiss case) before actually closing itself. That might just be a "don't do that" (i.e., make sure you always close yourself before opening another dialog), but it is a hidden constraint that could lead to a subtle bug here. So it might make sense to go ahead and find the current `handleKeyDown` in `_keydownListeners` and make sure we're removing the correct one from the array.