mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
fix(mobile): incorrect height of keyboard toolbar in ios (#8653)
### What Changes: - Fix keyboard height calculation with the `KeyboardToolBarConfig.useScreenHeight = true`. More detials in: https://github.com/toeverything/blocksuite/pull/8645 - Add safe bottom padding for shrinked keyboard toolbar - Add `VirtualKeyboard` polyfill. Close [AF-1573](https://linear.app/affine-design/issue/AF-1573/virtualkeyboard-polyfill-with-capacitor) - Since the `@capacitor/keyboard` dose not implement the `Keyboard.show()` method, this polyfill is not enabled now.
This commit is contained in:
@@ -10,6 +10,11 @@ import {
|
||||
LifeCycleWatcher,
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import type {
|
||||
RootBlockConfig,
|
||||
TelemetryEventMap,
|
||||
ThemeExtension,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
ColorScheme,
|
||||
EdgelessBuiltInManager,
|
||||
@@ -18,9 +23,7 @@ import {
|
||||
EditorSettingExtension,
|
||||
FontLoaderService,
|
||||
PageRootBlockSpec,
|
||||
type TelemetryEventMap,
|
||||
TelemetryProvider,
|
||||
type ThemeExtension,
|
||||
ThemeExtensionIdentifier,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
@@ -39,6 +42,7 @@ import { combineLatest, map } from 'rxjs';
|
||||
|
||||
import { getFontConfigExtension } from '../font-extension';
|
||||
import { createDatabaseOptionsConfig } from './database-block';
|
||||
import { createKeyboardToolbarConfig } from './widgets/keyboard-toolbar';
|
||||
import { createLinkedWidgetConfig } from './widgets/linked';
|
||||
import { createToolbarMoreMenuConfig } from './widgets/toolbar';
|
||||
|
||||
@@ -144,7 +148,8 @@ function getEditorConfigExtension(
|
||||
linkedWidget: createLinkedWidgetConfig(framework),
|
||||
toolbarMoreMenu: createToolbarMoreMenuConfig(framework),
|
||||
databaseOptions: createDatabaseOptionsConfig(framework),
|
||||
}),
|
||||
keyboardToolbar: createKeyboardToolbarConfig(),
|
||||
} satisfies RootBlockConfig),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { globalVars } from '@affine/core/mobile/styles/mobile.css';
|
||||
import { type KeyboardToolbarConfig } from '@blocksuite/affine/blocks';
|
||||
|
||||
export function createKeyboardToolbarConfig(): Partial<KeyboardToolbarConfig> {
|
||||
return {
|
||||
// TODO(@L-Sun): check android following the PR
|
||||
// https://github.com/toeverything/blocksuite/pull/8645
|
||||
useScreenHeight: BUILD_CONFIG.isIOS,
|
||||
safeBottomPadding: BUILD_CONFIG.isIOS ? globalVars.appTabHeight : '0px',
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user