Skip to content

Conversation

@humitos
Copy link
Member

@humitos humitos commented Feb 14, 2024

  • When clicking on the X, now it calls preventDefault() to avoid moving to the top
  • I added some id= attributes in the index page to test this manually

Closes #246

* When clicking on the X, now it calls `preventDefault()` to avoid moving to the top
* I added some `id=` attributes in the index page to test this manually

Closes #246
@humitos humitos requested a review from a team as a code owner February 14, 2024 15:48
@humitos humitos requested a review from agjohnson February 14, 2024 15:48
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

This makes sense. I assume this is because the link has a href="#" or similar, so this is a good way to avoid the default behavior here.

@humitos
Copy link
Member Author

humitos commented Feb 19, 2024

I assume this is because the link has a href="#"

Yes (https://github.com/readthedocs/readthedocs-client/blob/07e519e11143d399052c216ae831c012d516c209/src/notification.js#L212). Should we remove it?

@agjohnson
Copy link
Contributor

I would say it's fine as is, your fix does solve the problem. In places where we need to worry about users with JS disabled, it's best to make this a valid URL. But obviously we don't have that problem with Addons.

@humitos humitos merged commit 6b0fd20 into main Feb 19, 2024
@humitos humitos deleted the humitos/close-notification branch February 19, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dismissing PR preview banner loses position on the page

3 participants