Skip to content
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

site closes when clicking a link from the hamburger menu #2394

Closed
skshetry opened this issue Apr 18, 2021 · 4 comments
Closed

site closes when clicking a link from the hamburger menu #2394

skshetry opened this issue Apr 18, 2021 · 4 comments
Labels
p1-important Active priorities to deal within next sprints 🐛 type: bug Something isn't working. website: eng-doc DEPRECATED JS engine for /doc

Comments

@skshetry
Copy link
Member

skshetry commented Apr 18, 2021

How to reproduce

  1. Open https://dvc.org using "Open in a new tab" in the context menu from your phone (or, in a responsive mode from console). Please don't type, just use that earlier link.
  2. Open hamburger menu and click on either "Doc" or "Blog".

Expected

The page opens correctly.

Actual

The site just closes.


This happens because we are calling the window.close() in the HamburgerMenuIcon. I am not sure why it happens on a newly opened tab only (somewhere we are opening a new window based on that?).

const handleItemClick = useCallback(
item => (): void => {
close()
logEvent('hamburger', item)
},
[]
)

This also adds ugly warnings to the console:

Scripts may close only the windows that were opened by them.
@shcheklein shcheklein added 🐛 type: bug Something isn't working. p1-important Active priorities to deal within next sprints labels Apr 18, 2021
@shcheklein
Copy link
Member

I can't reproduce it on Mac (Chrome in a responsive mode)/iPhone, but can confirm warnings in the console. @skshetry what browser do you you use?

@shcheklein shcheklein added the website: eng-doc DEPRECATED JS engine for /doc label Apr 18, 2021
@skshetry
Copy link
Member Author

skshetry commented Apr 18, 2021

@shcheklein, did you use the "Open in a new tab" option for the above link?

EDIT: Sorry, looks like I didn't write the repro precisely. Now fixed.

@julieg18
Copy link
Contributor

I noticed the warnings while updating the hamburger menu and updated the code to stop using the close() method. @skshetry, can you confirm that the bug is gone?

@skshetry
Copy link
Member Author

Can confirm that it's fixed, and I don't see an error in the console either. Thanks, @julieg18. Closing ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-important Active priorities to deal within next sprints 🐛 type: bug Something isn't working. website: eng-doc DEPRECATED JS engine for /doc
Projects
None yet
Development

No branches or pull requests

4 participants