mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
refactor(editor): always show keyboard toolbar in mobile (#13384)
Close [AF-2756](https://linear.app/affine-design/issue/AF-2756/激活输入区的时候,展示toolbar,适配不弹虚拟键盘的场景,比如实体键盘) #### PR Dependency Tree * **PR #13384** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved virtual keyboard handling by introducing static keyboard height and app tab safe area tracking for more consistent toolbar behavior. * **Bug Fixes** * Enhanced keyboard visibility detection on Android and iOS, especially when a physical keyboard is connected. * **Refactor** * Simplified and streamlined keyboard toolbar logic, including delayed panel closing and refined height calculations. * Removed unused or redundant toolbar closing methods and position management logic. * **Style** * Updated toolbar and panel styles for better positioning and layout consistency. * Adjusted and removed certain mobile-specific padding styles. <!-- end of auto-generated comment: release notes by coderabbit.ai --> #### PR Dependency Tree * **PR #13384** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -120,7 +120,9 @@ framework.impl(VirtualKeyboardProvider, {
|
||||
const navBarHeight = (await AffineTheme.getSystemNavBarHeight())
|
||||
.height;
|
||||
callback({
|
||||
visible: true,
|
||||
// When an physical keyboard is connected, the virtual keyboard height is 0,
|
||||
// even though the `keyboardWillShow` event is still triggered.
|
||||
visible: info.keyboardHeight !== 0,
|
||||
height: info.keyboardHeight - navBarHeight,
|
||||
});
|
||||
})().catch(console.error);
|
||||
|
||||
Reference in New Issue
Block a user