diff --git a/components/PhoneInputDemo.vue b/components/PhoneInputDemo.vue
index 1014729..5d63e56 100644
--- a/components/PhoneInputDemo.vue
+++ b/components/PhoneInputDemo.vue
@@ -2,7 +2,7 @@
- ๐ฑ Perfect Phone Input - Like Screenshot 2
+ ๐ฑ Professional Phone Input - Desktop & Mobile Optimized
@@ -11,30 +11,42 @@
v-model="phoneNumber"
label="Phone Number"
placeholder="Enter your phone number"
- help-text="Clean Vuetify design with compact flag dropdown"
+ help-text="Clean Vuetify design with advanced mobile optimization"
@phone-data="handlePhoneData"
@country-changed="handleCountryChange"
/>
-
- Test: (917) 932-4061
-
-
-
- Test: Monaco +377
-
+
+
+ Test: (917) 932-4061
+
+
+
+ Test: Monaco +377
+
+
+
+ Test: France +33
+
+
@@ -45,13 +57,14 @@
Valid: {{ phoneData?.isValid ? 'โ
Valid' : 'โ Invalid' }}
Country: {{ phoneData?.country?.name }} ({{ phoneData?.country?.iso2 }})
Dial Code: {{ phoneData?.country?.dialCode }}
+ Device: {{ isMobile ? '๐ฑ Mobile' : '๐ฅ๏ธ Desktop' }}
- โ
Perfect Implementation:
+ ๐ฏ Perfect Desktop Implementation:
- Clean Design: Exactly like your screenshot - Vuetify text field with flag inside
- Compact Dropdown: Max 240px height, not oversized
@@ -63,13 +76,28 @@
- ๐ฏ Design Features:
+ ๐ฑ Advanced Mobile Optimization:
- - Flag size: 24x18px (perfect for text field)
- - Dropdown: Compact with search bar
- - Input field: Full width for phone number
- - Validation: Real-time phone number validation
- - Responsive: Works perfectly on mobile
+ - Mobile Detection: Automatic device detection with resize handling
+ - Full-Screen Modal: Mobile dropdown opens as centered modal with overlay
+ - Touch-Friendly: All elements sized for proper touch targets (44px+)
+ - iOS Safari Fixes: Prevents zoom on focus, proper appearance handling
+ - Android Material: Material Design touch targets and interactions
+ - Accessibility: Reduced motion, high contrast, screen reader support
+ - Safe Areas: Handles notched devices with proper padding
+ - Landscape Support: Optimized layout for landscape orientation
+ - Backdrop Blur: Modern glass morphism effects on supported devices
+ - Smooth Scrolling: Native touch scrolling with momentum
+
+
+
+
+ ๐งช Test Mobile Features:
+ To test mobile features, try:
+
+ - Resize Window: Make browser window narrow (< 768px)
+ - Developer Tools: Toggle device emulation in Chrome DevTools
+ - Touch Device: Test on actual phone/tablet for best experience
@@ -81,6 +109,21 @@ import PhoneInputWrapper from './PhoneInputWrapper.vue';
const phoneNumber = ref('');
const phoneData = ref(null);
+const isMobile = ref(false);
+
+// Mobile detection
+onMounted(() => {
+ const checkMobile = () => {
+ isMobile.value = window.innerWidth <= 768 || 'ontouchstart' in window;
+ };
+
+ checkMobile();
+ window.addEventListener('resize', checkMobile);
+
+ onUnmounted(() => {
+ window.removeEventListener('resize', checkMobile);
+ });
+});
const handlePhoneData = (data: any) => {
phoneData.value = data;
@@ -98,6 +141,10 @@ const testUSNumber = () => {
const testMonacoNumber = () => {
phoneNumber.value = '+37799123456';
};
+
+const testFrenchNumber = () => {
+ phoneNumber.value = '+33123456789';
+};