Android task entry fix
This commit is contained in:
@ -53,7 +53,13 @@ export class TaskEditorModal extends Modal {
|
||||
// on window with an explicit keyboardHeight so we use those as the primary
|
||||
// signal, with a visualViewport fallback for other environments.
|
||||
|
||||
// keyboardVisible tracks whether a Capacitor event has told us the
|
||||
// keyboard is open. The visualViewport fallback checks this flag so it
|
||||
// never resets a layout that Capacitor already applied.
|
||||
let keyboardVisible = false;
|
||||
|
||||
const applyLayout = (keyboardHeight: number) => {
|
||||
keyboardVisible = true;
|
||||
const available = window.innerHeight - keyboardHeight;
|
||||
this.containerEl.style.height = `${available}px`;
|
||||
this.containerEl.style.alignItems = 'flex-start';
|
||||
@ -61,6 +67,7 @@ export class TaskEditorModal extends Modal {
|
||||
this.modalEl.style.maxHeight = `${available - 16}px`;
|
||||
};
|
||||
const resetLayout = () => {
|
||||
keyboardVisible = false;
|
||||
this.containerEl.style.height = '';
|
||||
this.containerEl.style.alignItems = '';
|
||||
this.containerEl.style.paddingTop = '';
|
||||
@ -77,7 +84,10 @@ export class TaskEditorModal extends Modal {
|
||||
const onCapacitorHide = () => resetLayout();
|
||||
|
||||
// visualViewport fallback: works when adjustResize / adjustPan is active.
|
||||
// Skips the reset branch if Capacitor has already applied a layout, so it
|
||||
// doesn't undo the Capacitor-driven adjustment.
|
||||
const onViewport = () => {
|
||||
if (keyboardVisible) return;
|
||||
const vv = window.visualViewport;
|
||||
if (!vv) return;
|
||||
const kh = Math.max(0, window.innerHeight - vv.height - vv.offsetTop);
|
||||
|
||||
Reference in New Issue
Block a user