-
-
Notifications
You must be signed in to change notification settings - Fork 118
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 in _getElements when using selector & ns() #175
Comments
|
The commit you mention is in a different repository - is this bug present in this shinyjs or if the forked copy? If it's present here, please include a reproducible example |
Ignore my mention on that commit, it was in a previous bug report on this repository and I didn't realise the referenced commit was on a fork. Having looked at the source code I believe "asis" would also fix my problem in this case (pulling master now to check). Even if it does, the order of precedence between id and selector probably still needs looking at since you could logically use a selector with an id instead of the id parameter to do the same, however:
but in reality, it should |
Can you please include a full reproducible example that showcases the issue? Thanks :) |
Ah, commit 8627e85 fixes the issue in master. Any ETA on when a new stable will be available on CRAN? |
Before end of year |
Great, Thanks! |
@avsdev-cw it looks like I was a bit off... by more than a year! In case you wanted to know, I just submitted the new version to CRAN so it should be on CRAN next week. |
This bug occurs when trying to use the "selector" parameter of shinyjs::hide when you are also using shiny namespaces. The id parameter is always set using the namespace internally by shinyjs (even though the id parameter defaults to NULL) and due to the order of the if/else the selector parameter effectively gets ignored. I believe the precedence order of of _getElements needs to be changed using the below patch.
A better/future fix might be to check the id parameter of hide() because using NULL is a valid parameter:
I'm assuming this also applies to hideElement(), show(), showElement(), toggle() and toggleElement() since they all use the _getElements method
quick patch:
The text was updated successfully, but these errors were encountered: