mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 00:28:33 +00:00
## Summary Fixed the slash menu not appearing when typing `/` on mobile web browsers. ## Problem Mobile browsers don't reliably fire keyboard events (`keyDown`) when using virtual keyboards. This caused the slash menu trigger to fail on mobile devices. ## Solution - Changed from handling `keyDown` events to `beforeInput` events - `InputEvent` is fired consistently across all platforms (mobile and desktop) - Added proper handling for IME composition to avoid duplicate triggers - Uses `waitForUpdate()` to ensure the input is processed before checking for the trigger ## Test plan - [x] Tested on mobile Safari (iOS) - [x] Tested on mobile Chrome (Android) - [x] Verified desktop browsers still work correctly - [x] Verified IME input (e.g., Chinese/Japanese) doesn't trigger false positives Fixes #12910 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved slash menu input handling for better reliability and enhanced IME (input method editor) composition support. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->