This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
'country-selector--open': dropdownOpen,
|
||||
'country-selector--mobile': isMobile
|
||||
}"
|
||||
@click="toggleDropdown"
|
||||
@touchstart="handleTouchStart"
|
||||
>
|
||||
<img
|
||||
:src="flagUrl"
|
||||
@@ -311,9 +313,10 @@ const closeDropdown = () => {
|
||||
};
|
||||
|
||||
const handleTouchStart = (event: TouchEvent) => {
|
||||
// Prevent default to avoid unwanted behaviors on mobile
|
||||
if (isMobile.value) {
|
||||
event.preventDefault();
|
||||
// Allow natural touch behavior, just ensure dropdown works
|
||||
if (!dropdownOpen.value && !props.disabled) {
|
||||
dropdownOpen.value = true;
|
||||
searchQuery.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -324,10 +327,8 @@ const handleOverlayTouch = (event: TouchEvent) => {
|
||||
};
|
||||
|
||||
const handleCountryTouch = (event: TouchEvent) => {
|
||||
// Prevent default touch behaviors for better mobile experience
|
||||
if (isMobile.value) {
|
||||
event.preventDefault();
|
||||
}
|
||||
// Allow touch to work naturally for country selection
|
||||
// Don't prevent default as it interferes with click events
|
||||
};
|
||||
|
||||
// Initialize from modelValue
|
||||
|
||||
Reference in New Issue
Block a user