Skip to content

Fix autocomplete popup focus handling#17

Open
Lili889-ods wants to merge 1 commit into
Mudlet:masterfrom
Lili889-ods:fix-autocomplete-focus
Open

Fix autocomplete popup focus handling#17
Lili889-ods wants to merge 1 commit into
Mudlet:masterfrom
Lili889-ods:fix-autocomplete-focus

Conversation

@Lili889-ods

Copy link
Copy Markdown

Brief overview of PR changes/additions

Fixes autocomplete popup focus handling in TextEditorAutoCompleteComponent.

The autocomplete popup and its internal QListWidget are kept non-focusable and shown without activating. When autocomplete is visible, editor key events route only the autocomplete-specific commands to the list:

  • Up/Down/PageUp/PageDown move through suggestions.
  • Enter/Return/Tab accept the current suggestion.
  • Escape closes autocomplete.
  • Normal typing and Backspace stay with the editor.

A regression test covers that showing autocomplete keeps focus on the editor and that keyboard selection still works.

Motivation for adding to Mudlet

Mudlet issue #5310 reports that Lua autocomplete can steal focus and prevent continued typing. The root cause is that autocomplete currently calls listWidgetRef_->setFocus() after showing suggestions.

Other info (issues closed, discussion etc)

Related Mudlet issue: Mudlet/Mudlet#5310

Testing:

  • cmake -S 3rdparty/edbee-lib -B /private/tmp/mudlet-edbee-build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_QT5=OFF
  • cmake --build /private/tmp/mudlet-edbee-build --target edbee-lib -j4
  • git -C 3rdparty/edbee-lib diff --check

The new test source compiles, but I could not link/run the full local edbee-test executable on this macOS machine because the Qt test executable link step fails with ld: framework 'AGL' not found, unrelated to this change.

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.

1 participant