Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
- [Grid](#version-9x-grid)
- [Input Otp](#version-9x-input-otp)
- [Item Divider](#version-9x-item-divider)
- [Menu Toggle](#version-9x-menu-toggle)
- [Radio Group](#version-9x-radio-group)
- [Spinner](#version-9x-spinner)
- [Textarea](#version-9x-textarea)
Expand Down Expand Up @@ -272,6 +273,16 @@ If you were targeting the internals of `ion-input-otp` in your CSS, you will nee
- `--inner-padding-start` is replaced by `IonItemDivider.inner.padding.start` for global styles and `--ion-item-divider-inner-padding-start` for component-specific overrides.
- Specific theme classes (e.g., `ion-item-divider.md`) are no longer supported. Style modifications based on the active theme must be implemented using theme tokens rather than direct class targeting.

<h4 id="version-9x-menu-toggle">Menu Toggle</h4>

The following breaking changes apply to `ion-menu-toggle`:

1. Theme classes (`ion-menu-toggle.md`, `ion-menu-toggle.ios`) are no longer supported.

<h5>Theme classes</h5>

Remove any instances that target the theme classes: `ion-menu-toggle.md`, `ion-menu-toggle.ios`.

<h4 id="version-9x-radio-group">Radio Group</h4>

Converted `ion-radio-group` to use [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM).
Expand Down
1 change: 0 additions & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,6 @@ ion-menu-toggle,shadow
ion-menu-toggle,prop,autoHide,boolean,true,false,false
ion-menu-toggle,prop,menu,string | undefined,undefined,false,false
ion-menu-toggle,prop,mode,"ios" | "md",undefined,false,false
ion-menu-toggle,prop,theme,"ios" | "md" | "ionic",undefined,false,false

ion-modal,shadow
ion-modal,prop,animated,boolean,true,false,false
Expand Down
8 changes: 0 additions & 8 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2325,10 +2325,6 @@ export namespace Components {
* The mode determines the platform behaviors of the component.
*/
"mode"?: "ios" | "md";
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonModal {
/**
Expand Down Expand Up @@ -8345,10 +8341,6 @@ declare namespace LocalJSX {
* The mode determines the platform behaviors of the component.
*/
"mode"?: "ios" | "md";
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonModal {
/**
Expand Down
11 changes: 5 additions & 6 deletions core/src/components/menu-toggle/menu-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ import type { ComponentInterface } from '@stencil/core';
import { Component, Host, Listen, Prop, State, h } from '@stencil/core';
import { menuController } from '@utils/menu-controller';

import { getIonTheme } from '../../global/ionic-global';

import { updateVisibility } from './menu-toggle-util';

/**
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
*
* @slot - Content is placed inside the toggle to act as the click target.
*/
Expand Down Expand Up @@ -45,23 +42,25 @@ export class MenuToggle implements ComponentInterface {
@Listen('ionMenuChange', { target: 'body' })
@Listen('ionSplitPaneVisible', { target: 'body' })
async visibilityChanged() {
this.visible = await updateVisibility(this.menu);
try {
this.visible = await updateVisibility(this.menu);
} catch {
this.visible = false;
}
Comment on lines +45 to +49
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connectedCallback and the @Listen handlers discard the Promise returned by visibilityChanged(), so any rejection would surface as unhandled. The current chain can't reject, but catching here makes the method safe against future changes to menuController.get() (from @utils/menu-controller) or ion-menu's isActive.

}

private onClick = () => {
return menuController.toggle(this.menu);
};

render() {
const theme = getIonTheme(this);
const hidden = this.autoHide && !this.visible;

return (
<Host
onClick={this.onClick}
aria-hidden={hidden ? 'true' : null}
class={{
[theme]: true,
'menu-toggle-hidden': hidden,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/menu-toggle/test/button/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Menu - Button</title>
<title>Menu Toggle - Button</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/menu-toggle/test/list/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Menu - List</title>
<title>Menu Toggle - List</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/src/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1468,14 +1468,14 @@ export declare interface IonMenuButton extends Components.IonMenuButton {}


@ProxyCmp({
inputs: ['autoHide', 'menu', 'mode', 'theme']
inputs: ['autoHide', 'menu', 'mode']
})
@Component({
selector: 'ion-menu-toggle',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['autoHide', 'menu', 'mode', 'theme'],
inputs: ['autoHide', 'menu', 'mode'],
})
export class IonMenuToggle {
protected el: HTMLIonMenuToggleElement;
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/standalone/src/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1398,14 +1398,14 @@ export declare interface IonMenuButton extends Components.IonMenuButton {}

@ProxyCmp({
defineCustomElementFn: defineIonMenuToggle,
inputs: ['autoHide', 'menu', 'mode', 'theme']
inputs: ['autoHide', 'menu', 'mode']
})
@Component({
selector: 'ion-menu-toggle',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['autoHide', 'menu', 'mode', 'theme'],
inputs: ['autoHide', 'menu', 'mode'],
standalone: true
})
export class IonMenuToggle {
Expand Down