Skip to content

Call correct onInterceptHoverEvent super in onInterceptHoverEvent() - #1260

Merged
kirillzyusko merged 1 commit into
kirillzyusko:mainfrom
MegaManSec:j
Dec 30, 2025
Merged

kirillzyusko merged 1 commit into
kirillzyusko:mainfrom
MegaManSec:j

Conversation

@MegaManSec

@MegaManSec MegaManSec commented Dec 29, 2025 •

Copy link
Copy Markdown
Contributor

📜 Description

Fix a copy/paste mistake in OverKeyboardRootViewGroup.onInterceptHoverEvent. The method incorrectly delegates to super.onHoverEvent(event) instead of super.onInterceptHoverEvent(event), which bypasses the proper intercept path for hover events.

This change updates the return statement to call the correct superclass method.

💡 Motivation and Context

onInterceptHoverEvent is specifically intended to decide whether hover events should be intercepted before reaching child views. Calling super.onHoverEvent from the intercept override is incorrect and can lead to inconsistent hover/pointer behavior (including accessibility/hover dispatch) compared to the expected ViewGroup event flow.

This appears to be a straightforward copy/paste error given that onHoverEvent already calls super.onHoverEvent(event).

react-native PR for reference: react/react-native#54991

📢 Changelog

Android

  • Fixed onInterceptHoverEvent to call super.onInterceptHoverEvent(event) instead of super.onHoverEvent(event).

@kirillzyusko
kirillzyusko self-requested a review December 29, 2025 11:57
@kirillzyusko kirillzyusko self-assigned this Dec 29, 2025
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🤖 android Android specific OverKeyboardView Anything related to OverKeyboardView labels Dec 29, 2025
@kirillzyusko

Copy link
Copy Markdown
Owner

Thank you @MegaManSec for your PR! Let's wait for green CI and I'll merge it straight away!

@github-actions

Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
230183 bytes 230183 bytes 0 bytes 📉

@kirillzyusko

Copy link
Copy Markdown
Owner

Actually the same copy/paste error is present in DialogRootViewGroup (react-native codebase). You may want to submit a PR to RN core as well 😊

Could you please confirm, that screen reader (with enabled accessibility) works fine with these changes?

@MegaManSec

Copy link
Copy Markdown
Contributor Author

I didn't actually test these changes: it was picked up during a source code review.

I will report this to facebook/react-native too, thank you.

@kirillzyusko

Copy link
Copy Markdown
Owner

Okay, I'll test it then before merge 👍

For e2e tests I'm using detox, and this framework doesn't use a11y tree for testing (unlike Maestro, for example), so I'll conduct additional testing 👍

@kirillzyusko
kirillzyusko merged commit 838f546 into kirillzyusko:main Dec 30, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 android Android specific 🐛 bug Something isn't working OverKeyboardView Anything related to OverKeyboardView

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants