Skip to content

[autocomplete-plus] Ensure editor is re-focused…#1552

Open
savetheclocktower wants to merge 3 commits into
masterfrom
autocomplete-plus-fix-click-on-suggestion
Open

[autocomplete-plus] Ensure editor is re-focused…#1552
savetheclocktower wants to merge 3 commits into
masterfrom
autocomplete-plus-fix-click-on-suggestion

Conversation

@savetheclocktower

@savetheclocktower savetheclocktower commented May 7, 2026

Copy link
Copy Markdown
Contributor

…after the user selects a suggestion via the mouse.

@DeeDeeG observed this one in Discord and I was able to reproduce it, so I thought I'd get to the bottom of it while my attention span allowed me to!

Easy fix, but I have not written tests, nor have I investigated how easily this could be tested in automated fashion. We'd have to simulate a click with enough fidelity that the focus actually moved onto the suggestion element. I might return to this to write the spec later, or someone might manually verify it and then approve it before I get around to it! (EDIT: Spec has been written!)

Testing

  1. Trigger the autocompletion menu in an editor.
  2. Instead of confirming a choice via the keyboard, click on the choice you want via the mouse/trackpad.
  3. Without doing anything else, immediately start typing.

On master, nothing will happen, because focus isn't actually in the editor (even though you can see the cursor blinking).

On this PR branch, focus should return to the editor immediately so you can continue typing.

…after the user selects a suggestion via the mouse.
@DeeDeeG

DeeDeeG commented May 9, 2026

Copy link
Copy Markdown
Member

Spec failure in autocomplete-plus:

Autocomplete Manager
  when watching an external text editor for a given set of provider labels
    it provides appropriate autocompletions when each editor is focused.
      Error: Timed out waiting on condition
        at conditionPromise (/home/runner/work/pulsar/pulsar/node_modules/autocomplete-plus/spec/spec-helper.js:75:13)
        at jasmine.Spec.<anonymous> (/home/runner/work/pulsar/pulsar/node_modules/autocomplete-plus/spec/autocomplete-manager-integration-spec.js:2344:7)
ALL TESTS THAT FAILED:
Autocomplete Manager when watching an external text editor for a given set of provider labels provides appropriate autocompletions when each editor is focused.

@savetheclocktower

Copy link
Copy Markdown
Contributor Author

The newly failing spec probably describes a scenario that could not be replicated in the real world, but it was worth fixing anyway. The system works!

@savetheclocktower

Copy link
Copy Markdown
Contributor Author

Just pushed another commit to add the spec I threatened to add. The new spec fails on master and passes on this branch!

@savetheclocktower savetheclocktower added this to the 1.133.0 milestone May 9, 2026
@savetheclocktower

Copy link
Copy Markdown
Contributor Author

Bump; would be good to get an approval on this one. Might land it anyway if nobody objects.

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

Successfully merging this pull request may close these issues.

2 participants