Skip to content

Commit

Permalink
fix: prevent group items from being interactive in result list
Browse files Browse the repository at this point in the history
- Add group item checks to prevent mouse hover/click interactions
- Disable focus and enter actions for group items in result list
- Maintain existing behavior for non-group items
  • Loading branch information
qianlifeng committed Oct 30, 2024
1 parent dce4389 commit 188d16a
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,28 @@ class WoxQueryResultView extends GetView<WoxLauncherController> {
WoxQueryResult woxQueryResult = controller.getQueryResultByIndex(index);
return MouseRegion(
onEnter: (_) {
if (controller.isMouseMoved) {
if (controller.isMouseMoved && !woxQueryResult.isGroup) {
controller.setActiveResultIndex(index);
}
},
onHover: (_) {
if (!controller.isMouseMoved) {
if (!controller.isMouseMoved && !woxQueryResult.isGroup) {
controller.isMouseMoved = true;
controller.setActiveResultIndex(index);
}
},
child: GestureDetector(
onTap: () {
// request focus to action query box since it will lose focus when tap
controller.queryBoxFocusNode.requestFocus();
if (!woxQueryResult.isGroup) {
// request focus to action query box since it will lose focus when tap
controller.queryBoxFocusNode.requestFocus();
}
},
onDoubleTap: () {
controller.onEnter(const UuidV4().generate());
controller.queryBoxFocusNode.requestFocus();
if (!woxQueryResult.isGroup) {
controller.onEnter(const UuidV4().generate());
controller.queryBoxFocusNode.requestFocus();
}
},
child: WoxListItemView(
key: controller.getResultItemGlobalKeyByIndex(index),
Expand Down

0 comments on commit 188d16a

Please sign in to comment.