-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser navigation integration #1621
Conversation
…rent route in a browser and enable browser navigation calls.
2aff1a9
to
0424c64
Compare
navigation/navigation-runtime/src/webMain/kotlin/androidx/navigation/BrowserHistory.kt
Outdated
Show resolved
Hide resolved
navigation/navigation-runtime/src/webMain/kotlin/androidx/navigation/BrowserHistory.kt
Outdated
Show resolved
Hide resolved
navigation/navigation-runtime/src/webMain/kotlin/androidx/navigation/BrowserHistory.kt
Show resolved
Hide resolved
...gation/navigation-runtime/src/wasmJsMain/kotlin/androidx/navigation/BrowserHistory.wasmJs.kt
Outdated
Show resolved
Hide resolved
navigation/navigation-runtime/src/jsTest/kotlin/androidx/navigation/BrowserHistoryTest.kt
Show resolved
Hide resolved
|
||
localWindow.addEventListener("popstate", callback) | ||
awaitClose { | ||
localWindow.removeEventListener("popstate", callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: in wasmJs target removeEventListener
will work correctly only with kotlin 2.0.20 (https://youtrack.jetbrains.com/issue/KT-64565)
__
No actions required here.
It's just a note.
dc62db9
to
6d8fa1a
Compare
navigation/navigation-runtime/src/jsMain/kotlin/androidx/navigation/BrowserHistory.js.kt
Outdated
Show resolved
Hide resolved
navigation/navigation-runtime/src/jsMain/kotlin/androidx/navigation/BrowserHistory.js.kt
Outdated
Show resolved
Hide resolved
...gation/navigation-runtime/src/wasmJsMain/kotlin/androidx/navigation/BrowserHistory.wasmJs.kt
Outdated
Show resolved
Hide resolved
...gation/navigation-runtime/src/wasmJsMain/kotlin/androidx/navigation/BrowserHistory.wasmJs.kt
Outdated
Show resolved
Hide resolved
navigation/navigation-runtime/src/webMain/kotlin/androidx/navigation/BrowserHistory.kt
Outdated
Show resolved
Hide resolved
It looks like the functions are all |
No, it was the last-minute incorrect change. @terrakok will address it. Thanks |
Add
window.bindToNavigation(navController, getBackStackEntryPath)
method for web targets to show a current route in a browser and enable browser navigation calls.Screen.Recording.2024-10-08.at.18.02.46.mov
Fixes https://youtrack.jetbrains.com/issue/CMP-6818
Common code
JS/wasmJS code
Testing
Release Notes
Features - Navigation