Skip to content

fix: keep search focused while navigating the menu - #1209

Open
saadndm wants to merge 2 commits into
Polyfrost:v1from
saadndm:fix/search-focus
Open

saadndm wants to merge 2 commits into
Polyfrost:v1from
saadndm:fix/search-focus

Conversation

@saadndm

@saadndm saadndm commented Oct 18, 2026

Copy link
Copy Markdown
Member

Closes #1197

Comment on lines +245 to +246
commit(pending)
editingId = entries.getOrNull(index)?.id ?: -1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [P2] Preserve the clicked entry across chain normalization

When the setter removes duplicates, as the wWaypoints cycle does, committing can change entry positions as well as IDs. For example, editing 100 to 200 in [-1, 100, 200, 300] and clicking the existing 200 normalizes the chain to [-1, 200, 300]. Reusing index 2 then opens the editor for 300, so subsequent typing modifies the wrong entry. Remap the clicked entry after normalization instead of reusing its previous index.

awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Initial)
focusManager.clearFocus()
awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Final)
if (waitForUpOrCancellation(PointerEventPass.Final) != null) focusManager.clearFocus()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [P2] Wait for release on the Main pointer-event pass

An empty-space click with a small, unconsumed mouse movement can now leave search focused. waitForUpOrCancellation internally awaits Final again after checking the requested pass; passing Final makes that second await receive the next event instead. In a down–move–up sequence, the release is checked only for consumption, leaving the detector suspended without calling clearFocus(). Use the default Main pass or a loop that checks every final-pass event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

(feat): make search bar in focus after entering any mod menu

2 participants