Skip to content

react-selecto preventDefault and event propagation #177

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

Open
SerdarSanri opened this issue Feb 28, 2025 · 0 comments
Open

react-selecto preventDefault and event propagation #177

SerdarSanri opened this issue Feb 28, 2025 · 0 comments

Comments

@SerdarSanri
Copy link

First of all great script. Thank you for all contributed.

Is there any way to prevent default action or event propagation on selected elements? On react application, when I click on button element select event works fine but also triggers the click event on the element. I tried to add `preventDefault' but didn't seem to work. also tried

onSelect={e => {
                    console.log(e);
                    e.inputEvent.preventDefault();
                    e.inputEvent.stopPropagation();
                    e.inputEvent.stopImmediatePropagation();
}}

but that also doesn't seem to have any affect either. Button or link still receives click event and triggers handler.

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

1 participant