Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 13.3k
feat: add experimental hardware back button support in browsers#28705
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
746fa9fc131f363bc9c096b65dcbf34e136c7e9859f0dc0ed276f0da98fc331File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -72,7 +72,32 @@ type IonicEvents = { | ||
| ): void; | ||
| }; | ||
| type IonicWindow = Window & IonicEvents; | ||
| export interface CloseWatcher extends EventTarget { | ||
| new (options?: CloseWatcherOptions): any; | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having this return However, using | ||
| requestClose(): void; | ||
| close(): void; | ||
| destroy(): void; | ||
| oncancel: (event: Event) => void | null; | ||
| onclose: (event: Event) => void | null; | ||
| } | ||
| interface CloseWatcherOptions { | ||
| signal: AbortSignal; | ||
| } | ||
| /** | ||
| * Experimental browser features that | ||
| * are selectively used inside of Ionic | ||
| * Since they are experimental they typically | ||
| * do not have types yet, so we can add custom ones | ||
| * here until types are available. | ||
| */ | ||
| type ExperimentalWindowFeatures = { | ||
| CloseWatcher?: CloseWatcher; | ||
| }; | ||
| type IonicWindow = Window & IonicEvents & ExperimentalWindowFeatures; | ||
| type IonicDocument = Document & IonicEvents; | ||
| export const win: IonicWindow | undefined = typeof window !== 'undefined' ? window : undefined; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -204,6 +204,14 @@ export interface IonicConfig { | ||
| */ | ||
| platform?: PlatformConfig; | ||
| /** | ||
| * @experimental | ||
| * If `true`, the [CloseWatcher API](https://github.com/WICG/close-watcher) will be used to handle | ||
| * all Escape key and hardware back button presses to dismiss menus and overlays and to navigate. | ||
| * Note that the `hardwareBackButton` config option must also be `true`. | ||
thetaPC marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. liamdebeasi marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| */ | ||
| experimentalCloseWatcher?: boolean; | ||
| // PRIVATE configs | ||
| keyboardHeight?: number; | ||
| inputShims?: boolean; | ||
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.
I'm still deciding if we should target Ionic 8 vs. Ionic 7.7. Anyone have strong feelings one way or the other?
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.
No strong feelings since it's an opt-in feature. Maybe 7.7 b/c the sooner it comes out then the sooner the community can provide feedback if needed.
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.
^ Agreed.