-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 logic for retrieving lastKnownElement #16116
Conversation
Hi there @jdpnielsen, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Hello @jdpnielsen , Thank you for spotting this issue and providing the fix for it 👍 Cheers! |
Thanks @mikecp! Is there a good way to patch an existing Umbraco solution with this fix? |
Thanks @jdpnielsen - the existing code was already hard to read but your fix made it even harder to decode 😅 Usually, I wouldn't recommend refactoring things until asked / recommended, it makes it very hard for the team reviewing to see what has actually changed. Please confirm, the one and only change I can see here is actually: Both In that case, the other fix could have been I do appreciate the readability of the new code by the way, don't get me wrong, I just need to make sure I understand the scope of the change. |
As to your other question:
There really is no good way, this is all built and bundled and each NuGet restore will overwrite any changes you make. The only way you could do it is to make a custom build of this and host the output NuGet packages on (for example) MyGet. We're hoping to merge this fix soon and ship it in a release in the next few weeks (we don't have a solid release date yet). |
Agreed, this file is a giant mess! I was attempting to keep my changes as minimal as possible while restoring the intended functionality to how it was before the linked change.
That was a mistake - i have now changed it to check |
Thanks for the update @jdpnielsen! I was looking at the wrong thing, I see what you've done now by pulling the Tests well too, thanks for the help here! We're going to get a 13.3.1 out there in the next few weeks and this fix will be included in that. 👍 |
Prerequisites
This fixes #16057
Description
This resolves the linked issue. I believe the issue was introduced by the addition of an extra if-statement in this commit: 9730a18#diff-75783fbe92a64ae9a209d96c0ce71e8ddb7b04214f9f4f7ba1f73b78283f9a3aR98 from this PR: #10274
I'm assuming the linked pull request was attempting to prevent calling
.querySelector()
on an undefined element. I have solved this issue by using a ternary instead of a nested if-statement, which was preventing the fallback to$rootScope.lastKnownFocusableElements
from kicking in.