fix(lang): emit selected locale on close (#1234)

This commit is contained in:
Tachibana Shin
2026-05-18 14:55:48 +07:00
committed by GitHub
parent 94960c6cf5
commit c5afc6a9f9
2 changed files with 5 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ export default function LanguageSwitcher({ className = "", isOpen: controlledOpe
const isOpen = isControlled ? controlledOpen : internalOpen;
const setIsOpen = (value) => {
if (isControlled) {
if (!value && onClose) onClose();
if (!value && onClose) onClose(locale);
} else {
setInternalOpen(value);
}