-
Notifications
You must be signed in to change notification settings - Fork 262
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: isVisible weird behavior for 2.3.2 version #2016
Comments
I think this is because of a change in jsdom v21: some properties are now updated only if the element is attached to the DOM. Try adding |
hi @cexbrayat |
Hey. According to the jsdom issue it seems that jsdom behavior is going to stay and works "as expected". For the time being we are using a fix - Is there a specific issue that tracks this and the one I should follow? Thanks :) References: |
We can't fix it on VTU side, so yeah, the solution is to use attachTo 👍 |
I feel like this should be documented somewhere, or ideally even |
@alecgibson Great idea: would you mind opening a PR to add a note to the |
This change updates the documentation to reflect that `isVisible()` will only work correctly [when attached to the DOM][1] because of an upstream [`jsdom` issue][2]. [1]: vuejs#2016 [2]: jsdom/jsdom#3502
@cexbrayat I've raised a docs PR here: #2122 Would there be any appetite for throwing when trying to use this on an element not connected to the DOM? I always like my frameworks to shout at me if I'm using them incorrectly, but I acknowledge that trying to throw in this case is not necessarily as simple as it may seem. |
This change updates the documentation to reflect that `isVisible()` will only work correctly [when attached to the DOM][1] because of an upstream [`jsdom` issue][2]. [1]: #2016 [2]: jsdom/jsdom#3502
Thanks for the PR 👍 I'm not sure about throwing, because it works properly in many cases, and the behavior is only different with recent jsdom versions. We talked about attaching to the DOM by default, but we did not go further for now. |
As a consumer it's hard to know what these cases are, though (and I prefer to know it will always work). Attaching by default sounds relatively sensible (if potentially breaking...?), but if that's the stance that's fine; we'll work around it by patching or something. |
I kind of get the same behavior https://github.com/bootstrap-vue-next/bootstrap-vue-next/pull/1947/files#diff-06f4bc6a6331e64f2623754171c439baa0caa99533e6f3bad5b3e3fba8281f92 but even with attachTo, I need to manually refetch the It's not just an issue with isVisible though, it also doesn't update |
Describe the bug
I have been using version 2.2.6 for a while and it works great then I tried to update this module to 2.3.2 and got the issue with
isVisible
function behavior. As provided below, after accessingisVisible
for first time it's value will not be changed later even the virtual DOM has been updated correctly.To Reproduce
This is the component
This is the test
The text was updated successfully, but these errors were encountered: