Perhaps, `if (modal && e is MouseEvent)`