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

Draft
wants to merge 3 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: 51e94f6

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 26, 2024 7:04am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Nov 26, 2024 7:04am

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

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 51e94f6. 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.03% 🔺)
@blocksuite/affine/block-std 156.36 KB (-0.12% 🔽)
@blocksuite/affine/block-std/gfx 80.06 KB (-0.15% 🔽)
@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.01% 🔺)
@blocksuite/affine/blocks 1.96 MB (+0.01% 🔺)
@blocksuite/affine/blocks/schemas 88.53 KB (0%)

this.spaceKey$.value = false;
}
})
);
}

private _isEditableElement(evt: HTMLElement) {
return evt.closest('input, textarea, [contenteditable="true")') !== null;
Copy link

Choose a reason for hiding this comment

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

There's a syntax error in the CSS selector - [contenteditable="true") has an unmatched parenthesis instead of a closing bracket. The correct selector should be [contenteditable="true"].

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.


this.shiftKey$.value = state.raw.shiftKey && state.raw.key === 'Shift';
this._listenKeyboard('keyup', evt => {
this.shiftKey$.value = evt.shiftKey ? true : false;
Copy link

Choose a reason for hiding this comment

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

The shiftKey$ state handling in the keyup handler differs from the keydown logic. Currently, it will set shiftKey$ to true whenever any key is released while the shift key is held. To maintain consistency with the keydown behavior, the condition should be evt.shiftKey && evt.key === "Shift".

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

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.

1 participant