# Keyboard Bug Investigation ## ๐Ÿ› Problem Footer terangkat dan muncul area putih di bawah saat keyboard ditutup setelah input ke TextInput. ## ๐Ÿ“‹ Test Cases ### Test 1: Minimal Wrapper **File**: `test-keyboard-bug.tsx` Wrapper yang sangat sederhana: ```typescript Footer ``` **Expected**: Footer tetap di bawah **Actual**: ? (To be tested) ### Test 2: Original NewWrapper **File**: `components/_ShareComponent/NewWrapper.tsx` Wrapper yang digunakan di production: ```typescript {content} Footer ``` **Expected**: Footer tetap di bawah **Actual**: Footer terangkat, ada putih di bawah ## ๐Ÿ” Possible Causes ### 1. KeyboardAvoidingView Behavior - **Android**: `behavior="height"` mengurangi height view saat keyboard muncul - **Issue**: Saat keyboard close, height tidak kembali ke semula ### 2. View Wrapper dengan flex: 0 - NewWrapper menggunakan `` - Ini membuat ScrollView tidak expand dengan benar - **Fix**: Coba `` ### 3. Footer dengan position: absolute - Footer "melayang" di atas konten - Tidak ikut terdorong saat keyboard muncul - Saat keyboard close, footer kembali tapi layout sudah berubah ### 4. SafeAreaView Insets - Safe area insets berubah saat keyboard muncul - Footer tidak handle insets dengan benar ## ๐Ÿงช Test Scenarios 1. **Test Input Focus** - [ ] Tap Input 1 โ†’ Keyboard muncul - [ ] Footer tetap di bawah? 2. **Test Input Blur** - [ ] Tap Input 1 โ†’ Keyboard muncul - [ ] Tap outside โ†’ Keyboard close - [ ] Footer kembali ke posisi? - [ ] Ada putih di bawah? 3. **Test Multiple Inputs** - [ ] Tap Input 1 โ†’ Input 2 โ†’ Input 3 - [ ] Keyboard pindah dengan smooth - [ ] Footer tetap di bawah? 4. **Test Scroll After Close** - [ ] Input โ†’ Close keyboard - [ ] Scroll ke bawah - [ ] Footer terlihat? - [ ] Ada putih di bawah? ## ๐Ÿ”ง Potential Fixes ### Fix 1: Remove position: absolute ```typescript // Before {footer} // After {footer} ``` ### Fix 2: Use flex: 1 instead of flex: 0 ```typescript // Before // After ``` ### Fix 3: Use KeyboardAwareScrollView ```typescript import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' {content} ``` ### Fix 4: Manual keyboard handling ```typescript const [keyboardVisible, setKeyboardVisible] = useState(false); useEffect(() => { const show = Keyboard.addListener('keyboardDidShow', () => setKeyboardVisible(true)); const hide = Keyboard.addListener('keyboardDidHide', () => setKeyboardVisible(false)); return () => { show.remove(); hide.remove(); } }, []); ``` ## ๐Ÿ“ Test Results | Test | Platform | Result | Notes | |------|----------|--------|-------| | Test 1 (Minimal) | Android | ? | TBD | | Test 1 (Minimal) | iOS | ? | TBD | | Test 2 (Original) | Android | โŒ Bug | Footer terangkat | | Test 2 (Original) | iOS | ? | TBD | ## ๐ŸŽฏ Next Steps 1. Test dengan `TestWrapper` (minimal wrapper) 2. Identifikasi apakah bug dari wrapper atau React Native 3. Apply fix yang sesuai 4. Test di semua screen