Tests: Integration: Custom select: Ensure dialog is removed after destroying dialog-sized select menu.

Applied manually from b070b642348c401ea4170f5f1ca8df28db377dd3