Skip to content

Fix scrolling for nested views#6111

Merged
Wide-Cat merged 1 commit intoMeteorDevelopment:masterfrom
X-C-0:fix/view-in-view-focus
Feb 5, 2026
Merged

Fix scrolling for nested views#6111
Wide-Cat merged 1 commit intoMeteorDevelopment:masterfrom
X-C-0:fix/view-in-view-focus

Conversation

@X-C-0
Copy link
Contributor

@X-C-0 X-C-0 commented Feb 4, 2026

Type of change

  • Bug fix
  • New feature

Description

Context / Scenario

There are 2 views, one nested inside the other, and both have scrollOnlyWhenMouseOver = false. The user attempts to scroll while not hovering directly over any of the views.

Changes

Old logic:
The outer view took priority. propagateEvents for the inner view returned false because the check (mouseOver && isWidgetInView(widget)) || widget.isFocused() failed (since mouseOver was false).
Result: onMouseScrolled was never called for the inner view, so only the outer view scrolled. (See vid1)

New logic:
The inner view now takes priority.

  1. propagateEvents now checks if the widget is a WView. If so, it bypasses the strict mouseOver check and only validates isWidgetInView(widget) (checking for intersection to prevent scrolling invisible/off-screen views).
  2. The inner view handles onMouseScrolled. It returns true (consuming the event) only if it actually scrolled.
  3. If the inner view hits the bounds (top or bottom), it returns false, allowing the outer view to handle the scroll event. (See vid2)

Additional Fixes

In FontFaceSettingScreen, I changed the view's max height to be smaller than the window's view max height. This prevents unintended double scrolling in this specific case. (See vid3)

I have also removed boolean handlePressed from WView, since it could be replace with focused. (Epic memory save moment)

Related issues

fih 🐟

How Has This Been Tested?

Old view-in-view logic: vid1
Fixed view-in-view logic: vid2 <- this is just the view logic showcased
New single scroll font selection: vid3 <- this is actually how it looks ingame (without double scroll)

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@Wide-Cat Wide-Cat merged commit ec60aed into MeteorDevelopment:master Feb 5, 2026
1 check passed
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