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

Event Propagation in onPointerDrag #252

Closed
alvcarmona opened this issue May 6, 2024 · 3 comments · Fixed by #253
Closed

Event Propagation in onPointerDrag #252

alvcarmona opened this issue May 6, 2024 · 3 comments · Fixed by #253

Comments

@alvcarmona
Copy link

alvcarmona commented May 6, 2024

Hi there,

I'm encountering an issue with event propagation while using the onPointerDrag event in a RFeature component. I'm following an example from the documentation, but it seems that the example code includes a method called disablePropagation() on the RFeatureUIEvent object, which doesn't actually exist in the library. Consequently, I'm unable to prevent event propagation as intended.
onPointerDrag={useCallback((e) => { const coords = e.map.getCoordinateFromPixel(e.pixel); e.target.setGeometry(new Point(coords)); // This method doesn't exist on RFeatureUIEvent e.disablePropagation(); return false; }, [])}
I've tried using stopPropagation() which is available in RFeatureUIEvent and also preventDefault() as an alternative, but it doesn't fully address the issue. Could you please provide guidance on how to properly prevent event propagation in this context? I'd greatly appreciate any help or suggestions you can offer.

Thanks in advance!

@mmomtchev
Copy link
Owner

Do you really need it or do I have to waste my time only because someone has been checking my projects and looking for eventual bugs to try to convince me something?

@mmomtchev
Copy link
Owner

Don't try to make it look like you didn't notice that the line was underlined red.

As far as I am concerned, everyone in the GIS sector seems to be a retarded criminal, I don't see any other explanation of how we got here.

@alvcarmona
Copy link
Author

Thank you for your quick response and for providing a resolution to the problem. Your efforts are appreciated. Given that the fix has been implemented successfully, I wanted to kindly ask if you could consider publishing this update in the library.
Cheers

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

Successfully merging a pull request may close this issue.

2 participants