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

refactor(selection): keep setSelectedBlocks logic simple #1706

Conversation

fundon
Copy link
Contributor

@fundon fundon commented Mar 14, 2023

  1. click a image, selection.state.type switch to embed
  2. drag-and-drop image block, selection.state.type switch to block

The following methods are all for block:

state.selectedBlocks = selectedBlocks;
state.type = selectionType ?? state.type;
if (rects) {
slots.selectedRectsUpdated.emit(rects);

I think we can set the state after the drag and drop to block first to avoid confusion.

@codesandbox
Copy link

codesandbox bot commented Mar 14, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@vercel
Copy link

vercel bot commented Mar 14, 2023

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

Name Status Preview Comments Updated
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 15, 2023 at 1:17AM (UTC)
blocksuite-react ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 15, 2023 at 1:17AM (UTC)

@doodlewind doodlewind merged commit 87b071f into toeverything:master Mar 15, 2023
@fundon fundon deleted the refactor/keep-setSelectedBlocks-logic-simple branch March 15, 2023 02:04
@doodlewind
Copy link
Member

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants