Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: keyboard controller should attach event on document #8801

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

doouding
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Nov 25, 2024

⚠️ No Changeset found

Latest commit: 183652e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 3:10am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 3:10am

Copy link

graphite-app bot commented Nov 25, 2024

Your org has enabled the Graphite merge queue for merging into master

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

doouding commented Nov 25, 2024


How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

nx-cloud bot commented Nov 25, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 183652e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link
Contributor

github-actions bot commented Nov 25, 2024

size-limit report 📦

Path Size
@blocksuite/affine 13 B (0%)
@blocksuite/affine/effects 2.08 MB (+0.01% 🔺)
@blocksuite/affine/block-std 156.46 KB (-0.06% 🔽)
@blocksuite/affine/block-std/gfx 80.17 KB (-0.01% 🔽)
@blocksuite/affine/global 13 B (0%)
@blocksuite/affine/global/utils 13.87 KB (0%)
@blocksuite/affine/global/env 217 B (0%)
@blocksuite/affine/global/exceptions 562 B (0%)
@blocksuite/affine/global/di 1.65 KB (0%)
@blocksuite/affine/global/types 13 B (0%)
@blocksuite/affine/store 78.17 KB (0%)
@blocksuite/affine/inline 32.09 KB (0%)
@blocksuite/affine/inline/consts 51 B (0%)
@blocksuite/affine/inline/types 13 B (0%)
@blocksuite/affine/presets 1.87 MB (-0.02% 🔽)
@blocksuite/affine/blocks 1.96 MB (+0.03% 🔺)
@blocksuite/affine/blocks/schemas 88.53 KB (0%)

@doouding doouding marked this pull request as ready for review November 27, 2024 14:44
@doouding doouding requested a review from a team as a code owner November 27, 2024 14:44
Comment on lines +37 to +47
private _listenKeyboard(
event: 'keydown' | 'keyup',
callback: (keyboardEvt: KeyboardEvent) => void
) {
document.addEventListener(event, callback, false);

return () => {
document.removeEventListener(event, callback, false);
};
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does listening on the document affect user interactions on the AFFiNE side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. It should be fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested the situation where multiple editors exist at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants