Open tombuskens opened 5 days ago
Unlike left<>right arrow keys, Tabbing follows submission order. It kinda mimics what e.g. Win32 api exposed as tabbing order. One property of that is that it guarantees every item are reachable. But I generally agree that in this sorts of situation it's really not what anyone would expect to happen.
Unfortunately it means that Tabbing would need to be reworked to perform fuller scoring, similar to directional requests.
The logic in NavProcessItemForTabbingRequest()
would need to be reworked and folded into NavScoreItem()
.
It's likely to be a bit hairy to do right, but sounds possible.
In this case it does seem a bit unexpected indeed :) Would you know of a way to achieve this currently? I've got a UI where users can pick a subset of columns from a list to display, and these columns are used in a table with ImGuiTableFlags_Reorderable
set.
I had a go at some workarounds, but these all had issues:
DisplayOrderToIndex
order, using ImGui::TableSetColumnIndex(displayOrder)
- didn't seem to have the desired effect, and seems to interfere with mouse dragging the columns.ImGui::Shortcut(ImGuiKey_Tab)
to intercept the tab, determine the next cell, and use SetKeyboardFocusHere()
to focus. This seems to work (at least for non-header cells), but is rather finicky to get right.
Version/Branch of Dear ImGui:
Version 1.91.2 (19120), docking branch
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx12.cpp
Compiler, OS:
Windows 10, MSVC 1939
Full config/build information:
Details:
After reordering columns in a table, tabbing through columns via keyboard navigation tracks the original column order, instead of the reordered one.
Screenshots/Video:
https://github.com/user-attachments/assets/0a08c968-3520-4f9a-9679-30eb0c6fedc2
Minimal, Complete and Verifiable Example code:
Reproducible by using the unmodified Angled Headers demo. Drag a column to re-order it, click the first column header, then press TAB repeatedly. The column focus will follow the original column order instead of the re-ordered one.