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

Esc to cancel (bug - Sticky, cannot let go) #7

Closed
LukeTOBrien opened this issue Feb 4, 2021 · 3 comments
Closed

Esc to cancel (bug - Sticky, cannot let go) #7

LukeTOBrien opened this issue Feb 4, 2021 · 3 comments
Assignees

Comments

@LukeTOBrien
Copy link

Hi there,

I like your library very much and I have read your blog.

The app that I am creating is a scene editor, the user can edit a scene by moving entities arround with their mouse.
I have an issue whereby once I click on a shape then it 'stick' to the mouse cursor and I cannot let it go, so I guess an event is not firing.

I also thourght that pressing the esc key would be a good way to cancel the drag and revert the entity bac to it's origional position.

@extraymond
Copy link
Owner

I have encounter the same issue if you start drag and get out of the scene object, then you get your cursor back in.
Try to maximize the a-scene object so no underlying object can hijack the needed events.

@LukeTOBrien
Copy link
Author

One thing that I didn't mention is that my scene is embedded.
So even though my scene is near-full-screen it is still embedded.
The docs also say:

Use interaction with HTML elements (e.g., buttons, forms) to affect the scene

So perhaps embedded is somehow causing the event not to fire?
Your component is exactly the kind of thing that I need though, perhaps I should do some tinkering?

@extraymond
Copy link
Owner

extraymond commented Feb 16, 2021

@LukeTOBrien Sorry for the long waiting, just came back from holiday. Yes embedded is the culprit.

this.el.addEventListener("click", e => {

Currently, the drop action is detected when the a-scene node detected the click event, which will not happen if you click outside of the a-scene node. One solution is to force fire up the click on the a-scene node manually when clicking on the outside div.

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

No branches or pull requests

2 participants