Fix the click behavior for <tr> and <td> with [data-href] #17388

Merged
lunny merged 2 commits from fix-td-click into main 2021-10-21 18:19:32 +00:00
Contributor

There was JS code making table <tr> and <td> elements clickable like a link, but the behavior is not the same as modern browsers.

This PR makes the click behavior for <tr> and <td> with [data-href] the same as modern browsers: if a user clicks it with key Ctrl(Windows) or Meta(macOS) pressed, the link will be opened in a new window/tab.

Also, if there is a <a> inside the <td>, we should not process the click event because the <a> already handles it.

There was JS code making table `<tr>` and `<td>` elements clickable like a link, but the behavior is not the same as modern browsers. This PR makes the click behavior for `<tr>` and `<td>` with `[data-href]` the same as modern browsers: if a user clicks it with key Ctrl(Windows) or Meta(macOS) pressed, the link will be opened in a new window/tab. Also, if there is a `<a>` inside the `<td>`, we should not process the click event because the `<a>` already handles it.
zeripath approved these changes 2021-10-21 16:12:53 +00:00
noerw (Migrated from github.com) approved these changes 2021-10-21 17:13:14 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#17388
No description provided.