Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
Created November 11, 2025 09:14
Show Gist options
  • Save oberhamsi/10e7dfbcf991a44b846f444977f9be0b to your computer and use it in GitHub Desktop.
Save oberhamsi/10e7dfbcf991a44b846f444977f9be0b to your computer and use it in GitHub Desktop.
workaround onNavigation on Root
const spatialNavigation = new SpatialNavigation(
oonMediaRootNavigationGroup,
new TwoLevelNavigationGroup(settingsPopupContainer, settingsTwoLevelMenu)
);
oonMediaRootNavigationGroup.onNavigation = (
direction: any,
target: any,
preventDefault: any
) => {
let seekbarHandlerPreventDefault = false;
const preventDefaultSeekbar = () => (seekbarHandlerPreventDefault = true);
spatialNavigation?.seekBarHandler.onNavigation(direction, target, preventDefaultSeekbar);
if (seekbarHandlerPreventDefault) {
preventDefault();
return;
}
if (!oonMediaRootNavigationGroup.activeComponent) {
return;
}
const targetComponent = getComponentInDirection(
oonMediaRootNavigationGroup.activeComponent,
oonMediaRootNavigationGroup.getComponents(),
direction
);
if (!targetComponent) {
console.log('DO SOMETHING SPECIAL');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment