-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Possible fix for 4973 #5006
base: master
Are you sure you want to change the base?
Possible fix for 4973 #5006
Conversation
Good catch. Asynchronous code bites us once again 😄 I have an alternative that might work and also be simpler:
|
I haven't had a chance to test yet, but I think your suggested fix won't work. As I noted in #4973 (should have mentioned above as well), removeComponent also (synchronously) deletes the DOM Attribute. The DOM Attribute doesn't get added back in on the update, because that's only done when the component does not exist. So with your suggested fix, I think we would end up without the attribute in the DOM. I considered delaying the removal of the DOM attribute to the async phase of removal, but that felt riskier, as it introduces more change to mainline paths. |
Catching up on this after a long period... I did try a fix along the lines of @dmarcos's proposal. It was possible, but it ended up a lot more complicated. I have synchronized both branches with master, so either could be merged if wanted. My preference is to stick with the original fix, but I think I should add a Unit Test. Other thing I noticed when testing with this glitch is that neither block went red when I set attribute Seems like a potential regression in A-Frame master? I'll try & isolate that with a Unit Test as well. |
This fix is not good-to-go yet. Some not-yet-checked-in UTs have thrown up some further issues that the fix doesn't yet address. |
Description:
A fix for #4973.
In brief...
Changes proposed:
-- clear this flag (so that the removal is cancelled)
-- recreate the component's corresponding attribute in the DOM (since this will have been removed asynchronously by removeAttribute().
As per #4973 there is a sample glitch that I have used to verify the fix here:
https://glitch.com/edit/#!/modifying-attributes-after-creation?path=index.html%3A1%3A0
Not sure whether this can be incorporated into A-Frame as an additional test case?