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

Thorium 2.4.x : on MacOS (probably other OS too) mouse click + mod keys on React router links in GUI trigger new blank window or download (e.g. localhost in dev, library_index.html in prod) #2233

Closed
danielweck opened this issue May 17, 2024 · 1 comment

Comments

@danielweck
Copy link
Member

@panaC we observed this in Thorium3 too, probably a React Router breaking change (event.preventDefault() handling). So, we can't fix this in 2.4.x but we have to make sure this doesn't happen in 3.x.x

@danielweck
Copy link
Member Author

danielweck commented May 26, 2024

I checked possible occurrences of this undesirable behaviour in Thorium3. Basically, any "a" hyperlink element with "href" attribute (even empty) activates behaviours that otherwise remain dormant, such as keyboard tab stop, ENTER key handling, onClick event listener (and its counterpart onDoubleClick), "visited" CSS pseudo class, role of SHIFT and ALT/OPT keys which trigger download or external window target (CTRL triggers context menu in dev mode), etc.. I documented the behaviours inline the relevant TypeScript code. Usually, event.preventDefault() suffices and makes logical sense as Thorium mostly performs custom hyperlink handling, or delegates to the local / default web browser via an Electron API. Note that "button" elements inside (or not inside) forms also come with their own behaviours, I reviewed that too in Thorium3. However there remains the issue of some GUI controls being "a" when they could be "button" elements, or vice-versa (there is a semantic distinction of course, as well as practical considerations such as the role of the SPACE key (scroll viewport, vs. activate a button onClick). I tested all with screen reader (Voice Over on Mac). Anyway, closing this now.

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

No branches or pull requests

1 participant