[RTL] Navigating through devtools tabs with arrow keys is reversed
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(firefox71 verified)
Tracking | Status | |
---|---|---|
firefox71 | --- | verified |
People
(Reporter: itiel_yn8, Assigned: mv, Mentored)
Details
(Keywords: good-first-bug, rtl)
Attachments
(1 file)
Using Windows 10, latest Nightly.
STR:
- In about:config change 'intl.uidirection' to 1 and restart Nightly
- Open devtools
- Focus e.g. the Inspector tab
- Press the left arrow key to move to the devtools tab on the left
AR:
Focus goes to the tab on Inspector's right.
ER:
Focus should have gone to the tab on the left.
Updated•6 years ago
|
Comment 3•6 years ago
|
||
The Tabs
component (devtools/client/shared/components/tabs/Tabs.js) seems to handle highlighting the tabs on arrow key press, but it doesn't take into account the document language direction.
onKeyDown(event) {
// Bail out if the focus isn't on a tab.
if (!event.target.closest(".tabs-menu-item")) {
return;
}
let activeTab = this.state.activeTab;
const tabCount = this.props.children.length;
switch (event.code) {
case "ArrowRight":
activeTab = Math.min(tabCount - 1, activeTab + 1);
break;
case "ArrowLeft":
activeTab = Math.max(0, activeTab - 1);
break;
}
if (this.state.activeTab != activeTab) {
this.setActive(activeTab);
}
}
With a bit of guidance, I believe this could be a good candidate for a good-first-bug.
I'll assign myself as a mentor and help anyone who wants to work on it.
To get your development set up, please start here: https://docs.firefox-dev.tools/
Assignee | ||
Comment 4•6 years ago
|
||
Hi! Going to try and tackle this. I'll submit an initial patch, though I feel like I'll need some help for tests.
Assignee | ||
Comment 5•6 years ago
|
||
Fix arrow keys behavior on tabs when document direction is RTL
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6847c6c481f3
Fix arrow keys behavior on tabs when document direction is RTL. r=rcaliman
Comment 7•6 years ago
|
||
bugherder |
Description
•