Skip to content

Fix JS error when hasFocus method is overwritten on search index load #2735

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

Merged
merged 2 commits into from
Jun 28, 2025

Conversation

GuillaumeGomez
Copy link
Member

Fixes the following JS error:

image

It's because of #2633: instead of adding new properties, I completely overwrote the window.search object, removing all the methods originally defined on it. This fixes it.

@GuillaumeGomez GuillaumeGomez requested a review from ehuss June 25, 2025 16:25
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Jun 25, 2025
@@ -1,5 +1,6 @@
// This tests basic search behavior.

fail-on-js-error: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this value the default in browser-ui-test because it would have helped me catch this error much sooner.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #2736.

@GuillaumeGomez
Copy link
Member Author

CI passed. \o/

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss added this pull request to the merge queue Jun 28, 2025
Merged via the queue into rust-lang:master with commit e395341 Jun 28, 2025
14 checks passed
@GuillaumeGomez GuillaumeGomez deleted the fix-js-error branch June 28, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants