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

fix: Fix checking if scope is a jquery element #4176

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Jan 14, 2025

Fixes rstudio/bslib#1159

Apparently there are cases where .bindAll() can be called on a text node rather than an HTMLElement or a jquery-wrapped element. The code path where this was observed was through the shiny-insert-tab message handler (see linked issue for a reprex).

I couldn't track down how that behavior arises. But it only becomes relevant for us when we want to dispatch the error console event since you can't dispatch an event on a text node.

This PR improves the check that differentiates between jQuery objects and DOM nodes and ensures that checkValidity() doesn't try to dispatch an event or call .get() on a text node.

@gadenbuie gadenbuie force-pushed the fix/binding-check-jquery branch from ec327ab to db123a1 Compare January 14, 2025 18:30
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 this pull request may close these issues.

bslib::nav_insert() with repeated inputs fails with error console changes in shiny 1.10.0
1 participant