super-productivity/capacitor.config.ts
johannesjo 1421151724 fix(ios): prevent keyboard from overlapping inputs
Use Capacitor's native WebView resize mode on iOS instead of CSS-based
workarounds. When keyboard appears, the WebView itself shrinks so 100vh
automatically fits above the keyboard.

- Configure iOS to use `resize: 'native'` (Android keeps `resize: 'body'`)
- Add scrollIntoViewIfNeeded() to scroll focused inputs into view
- Add proper cleanup for keyboard event listeners
- Improve flexbox shrinking in fullscreen markdown dialog
2026-01-21 17:45:14 +01:00

47 lines
1.3 KiB
TypeScript

import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.super-productivity.app',
appName: 'Super Productivity',
webDir: 'dist/browser',
plugins: {
CapacitorHttp: {
enabled: true,
},
LocalNotifications: {
// Android-specific: small icon for notification
smallIcon: 'ic_stat_sp',
},
Keyboard: {
// Default: resize body (Android)
resize: 'body',
resizeOnFullScreen: true,
},
StatusBar: {
// Status bar overlays webview (iOS)
overlaysWebView: false,
},
},
ios: {
// Content inset for safe areas (notch, home indicator)
contentInset: 'automatic',
// Background color for safe areas (home indicator, notch)
// Use dark color to match dark theme (most common on mobile)
backgroundColor: '#131314',
// Allow inline media playback
allowsLinkPreview: true,
// Scroll behavior
scrollEnabled: true,
// iOS-specific plugin overrides
plugins: {
Keyboard: {
// Resize the native WebView when keyboard appears
// This shrinks the viewport so 100vh/100% automatically fits above keyboard
resize: 'native',
resizeOnFullScreen: true,
},
},
},
};
export default config;