Created
November 11, 2025 09:14
-
-
Save oberhamsi/10e7dfbcf991a44b846f444977f9be0b to your computer and use it in GitHub Desktop.
workaround onNavigation on Root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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