Most links in user interface are made with <div onClick=...> intead of <a href=...>

Open
#12,527 13 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript, react

Research direction

Start by locating the React UI components that render clickable navigation elements, then compare their use of useNavigate() with React Router’s Link. The issue names no files or tests, so first identify the affected links and check how they are exercised. Done means links use browser-recognizable anchors and right-clicking offers the correct link context menu.

Written by the indexing model from the issue text.

Description

question User Interface
Please verify that this bug has NOT been raised before.
  • I checked and didn't find a similar issue
Describe the bug*

The new React user interface is amazing. However, there is one thing that is really annoying. Most links are made with a <div onClick=...> instead of a <a href=...>. This means that the browser can not distinguish between text and links and will show the wrong context menu on right click. There is no way to copy a link without first opening it.

InvenTree is using react-router. All links should be made with a <Link to=...> instead of the useNavigate() hook.

Steps to Reproduce
  1. Right click (almost) any link
  2. The browser will show the wrong context menu
Expected behaviour

The browser should display the correct context menu.

Deployment Method

Docker

Version Information

1.4.0

Try to reproduce on the demo site

I tried to reproduce

Is the bug reproducible on the demo site?

Reproducible

Relevant log output

Dominant language
Python
Stars
7.7k
Forks
1.6k
Avg merge
21h 45m
Merged PRs (30d)
204

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from inventree/InvenTree

All issues in inventree/InvenTree

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.