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

[Bug]: Expected an editing shape! #3762

Closed
1 task done
Kesavaraja opened this issue May 16, 2024 · 3 comments · Fixed by #3771
Closed
1 task done

[Bug]: Expected an editing shape! #3762

Kesavaraja opened this issue May 16, 2024 · 3 comments · Fixed by #3771
Labels
bug Something isn't working

Comments

@Kesavaraja
Copy link
Contributor

What happened?

I have a Custom shape in Page 1 and user is editing the shape, Suddenly he switches the page and add the same shape (using createShape) and when he clicks the shape this particular issue is getting raised.

How can we reproduce the bug?

Custom shape in Page 1 and user is editing the shape, Suddenly he switches the page and add the same shape (using createShape) and when he clicks the shape this particular issue is getting raised.

What browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

Contact Details

k7raja@live.com

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Kesavaraja Kesavaraja added the bug Something isn't working label May 16, 2024
Copy link

linear bot commented May 16, 2024

@ds300
Copy link
Collaborator

ds300 commented May 17, 2024

Suddenly he switches the page

Is this happening programatically? i.e. are you are calling setCurrentPage somehow while the user is editing a shape?

I was able to reproduce this error that way, but I can't reproduce if I switch the page by clicking in the UI because it cancels the select.editing_shape interaction, which is the interaction that causes this bug.

I think it might make sense for us to call onComplete. I added a PR that might fix this here: #3771

@Kesavaraja
Copy link
Contributor Author

@ds300 Yes you are right. I have used setCurrentPage to switch page.
Thanks for the clarification.

github-merge-queue bot pushed a commit that referenced this issue May 20, 2024
Looking at #3762 it seemed to have been caused by calling
`setCurrentPage` during a `select.editing_shape` interaction. I wonder
whether we should trigger a `cancel` event before switching pages in
case this happens?

closes #3762 

### Change Type

<!-- ❗ Please select a 'Scope' label ❗️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!-- ❗ Please select a 'Type' label ❗️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Add a brief release note for your PR here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants