Skip to content

Commit 0b9cab0

Browse files
committed
fix: move TapHandler outside MouseArea to fix event handling
Moved the TapHandler from inside the MouseArea to be a direct child of the NotifyItem. This change resolves event handling conflicts where the TapHandler was not receiving taps properly due to being nested within the MouseArea. The TapHandler is now positioned after the MouseArea in the QML structure, ensuring it can properly capture tap events for expanding notifications when enabled. Log: Fixed notification expansion not working when clicking on certain areas Influence: 1. Test clicking on notification items to ensure they expand correctly 2. Verify that notifications with enableDismissed=false can be expanded via tap 3. Test keyboard navigation with Enter/Return keys still works for expansion 4. Verify that dismissed notifications (enableDismissed=true) cannot be expanded 5. Check that focus handling works correctly when tapping notifications fix: 将 TapHandler 移出 MouseArea 以修复事件处理 将 TapHandler 从 MouseArea 内部移动到 NotifyItem 的直接子元素。此更改解 决了事件处理冲突,由于 TapHandler 嵌套在 MouseArea 内导致无法正确接收点 击事件的问题。现在 TapHandler 在 QML 结构中位于 MouseArea 之后,确保在启 用时能够正确捕获用于展开通知的点击事件。 Log: 修复了点击某些区域时通知无法展开的问题 Influence: 1. 测试点击通知项以确保它们能正确展开 2. 验证 enableDismissed=false 的通知可以通过点击展开 3. 测试键盘导航,确保 Enter/Return 键仍能用于展开 4. 验证已关闭的通知(enableDismissed=true)无法展开 5. 检查点击通知时的焦点处理是否正常工作 PMS: BUG-353605
1 parent 1834298 commit 0b9cab0

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

panels/notification/center/OverlapNotify.qml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,16 @@ NotifyItem {
180180
}
181181
}
182182
}
183-
184-
// expand
185-
TapHandler {
186-
enabled: !root.enableDismissed
187-
acceptedButtons: Qt.LeftButton
188-
onTapped: {
189-
root.forceActiveFocus()
190-
root.expand()
191-
}
192-
}
193183
Keys.onEnterPressed: root.expand()
194184
Keys.onReturnPressed: root.expand()
195185
}
186+
// expand
187+
TapHandler {
188+
enabled: !root.enableDismissed
189+
acceptedButtons: Qt.LeftButton
190+
onTapped: {
191+
root.forceActiveFocus()
192+
root.expand()
193+
}
194+
}
196195
}

0 commit comments

Comments
 (0)