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(login): Fix JS error on login grant page #41117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thank you!
/backport to stable27 |
/backport to stable26 |
That code has been in-place since NC20 via #17683. Why hasn't this lead to more bug reports... Or has it? 🤔 |
/backport to stable25 |
@@ -3,7 +3,7 @@ document.querySelector('form').addEventListener('submit', function(e) { | |||
if (wrapper === null) { | |||
return | |||
} | |||
wrapper.getElementsByClassName('icon-confirm-white').forEach(function(el) { | |||
Array.from(wrapper.getElementsByClassName('icon-confirm-white')).forEach(function(el) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or wrapper.querySelectorAll
which returns a NodeList.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as querySelectorAll
will have to do extra checks (the query could be anything) it will take much longer than you gain by omitting the array conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(At least when I last benchmarked both with ~1k elements it took twice as long 😅 )
Closes #41098 Signed-off-by: Magnus Anderssen <magnus@magooweb.com>
Cypress is unrelated this seems to happen only on foreign repositories, somehow the 3rdparty submodule does not match up and then CI fails |
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
/backport to stable26 |
/backport to stable25 |
Summary
HTMLCollection
does not have aforEach
method, so convert to array first.Checklist