BREAKING CHANGE: Button is updated to align with the design specification for iOS. **Design tokens** | Token | Previous Value | New Value | | ---------------------------------- | -------------- | --------- | | `$button-ios-letter-spacing` | `-0.03em` | `0` | | `$button-ios-clear-letter-spacing` | `0` | Removed | | `$button-ios-height` | `2.8em` | `3.1em` | | `$button-ios-border-radius` | `10px` | `14px` | | `$button-ios-large-height` | `2.8em` | `3.1em` | | `$button-ios-large-border-radius` | `12px` | `16px` |
31 KiB
Breaking Changes
This is a comprehensive list of the breaking changes introduced in the major version releases of Ionic Framework.
Versions
Version 7.x
Browser and Platform Support
This section details the desktop browser, JavaScript framework, and mobile platform versions that are supported by Ionic 7.
Minimum Browser Versions
| Desktop Browser | Supported Versions |
|---|---|
| Chrome | 79+ |
| Safari | 14+ |
| Firefox | 70+ |
| Edge | 79+ |
Minimum JavaScript Framework Versions
| Framework | Supported Version |
|---|---|
| Angular | 14+ |
| React | 17+ |
| Vue | 3.0.6+ |
Minimum Mobile Platform Versions
| Platform | Supported Version |
|---|---|
| iOS | 14+ |
| Android | 5.1+ with Chromium 79+ |
Components
Accordion Group
-
ionChangeis no longer emitted when thevalueofion-accordion-groupis modified externally.ionChangeis only emitted from user committed changes, such as clicking or tapping the accordion header. -
Accordion Group no longer automatically adjusts the
valueproperty when passed an array andmultiple="false". Developers should update their apps to ensure they are using the API correctly.
Action Sheet
- Action Sheet is updated to align with the design specification.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
--height |
100% |
auto |
Button
- Button is updated to align with the design specification for iOS.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
$button-ios-letter-spacing |
-0.03em |
0 |
$button-ios-clear-letter-spacing |
0 |
Removed |
$button-ios-height |
2.8em |
3.1em |
$button-ios-border-radius |
10px |
14px |
$button-ios-large-height |
2.8em |
3.1em |
$button-ios-large-border-radius |
12px |
16px |
Back Button
- Back Button is updated to align with the design specification for iOS.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
--icon-margin-end |
-5px |
1px |
--icon-font-size |
1.85em |
1.6em |
Card Header
- The card header has ben changed to a flex container with direction set to
column(top to bottom). Iniosmode the direction is set tocolumn-reversewhich results in the subtitle displaying on top of the title.
Checkbox
-
ionChangeis no longer emitted when thecheckedproperty ofion-checkboxis modified externally.ionChangeis only emitted from user committed changes, such as clicking or tapping the checkbox. -
The
--backgroundand--background-checkedCSS variables have been renamed to--checkbox-backgroundand--checkbox-background-checkedrespectively.
Datetime
-
ionChangeis no longer emitted when thevalueproperty ofion-datetimeis modified externally.ionChangeis only emitted from user committed changes, such as clicking or tapping a date. -
Datetime no longer automatically adjusts the
valueproperty when passed an array andmultiple="false". Developers should update their apps to ensure they are using the API correctly. -
Datetime no longer incorrectly reports the time zone when
valueis updated. Datetime does not manage time zones, so any time zone information provided is ignored. -
Passing the empty string to the
valueproperty will now error as it is not a valid ISO-8601 value. -
The haptics when swiping the wheel picker are now enabled only on iOS.
Input
-
ionChangeis no longer emitted when thevalueofion-inputis modified externally.ionChangeis only emitted from user committed changes, such as typing in the input and the input losing focus, clicking the clear action within the input, or pressing the "Enter" key.- If your application requires immediate feedback based on the user typing actively in the input, consider migrating your event listeners to using
ionInputinstead.
- If your application requires immediate feedback based on the user typing actively in the input, consider migrating your event listeners to using
-
The
debounceproperty has been updated to control the timing in milliseconds to delay the event emission of theionInputevent after each keystroke. Previously it would delay the event emission ofionChange. -
The
debounceproperty's default value has changed from0toundefined. Ifdebounceis undefined, theionInputevent will fire immediately. -
The
detailpayload for theionInputevent now contains an object with the currentvalueas well as the native event that triggeredionInput.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
--placeholder-opacity |
0.5 |
0.6 |
Item
Design tokens
iOS:
| Token | Previous Value | New Value |
|---|---|---|
$item-ios-font-size |
17px |
16px |
--inner-padding-end |
10px |
16px |
--padding-start |
20px |
16px |
Modal
- The
swipeToCloseproperty has been removed in favor ofcanDismiss. - The
canDismissproperty now defaults totrueand can no longer be set toundefined.
Overlays
Ionic now listens on the keydown event instead of the keyup event when determining when to dismiss overlays via the "Escape" key. Any applications that were listening on keyup to suppress this behavior should listen on keydown instead.
Picker
- The
refreshkey has been removed from thePickerColumninterface. Developers should use thecolumnsproperty to refresh theion-pickerview.
Radio Group
ionChangeis no longer emitted when thevalueofion-radio-groupis modified externally.ionChangeis only emitted from user committed changes, such as clicking or tapping anion-radioin the group.
Range
-
Range is updated to align with the design specification for supported modes.
Design tokens
iOS:
Token Previous Value New Value --bar-border-radius0px$range-ios-bar-border-radius(2pxdefault)--knob-size28px$range-ios-knob-width(26pxdefault)$range-ios-bar-height2px4px$range-ios-bar-background-colorrgba(var(--ion-text-color-rgb, 0, 0, 0), .1)var(--ion-color-step-900, #e6e6e6)$range-ios-knob-box-shadow0 3px 1px rgba(0, 0, 0, .1), 0 4px 8px rgba(0, 0, 0, .13), 0 0 0 1px rgba(0, 0, 0, .02)0px 0.5px 4px rgba(0, 0, 0, 0.12), 0px 6px 13px rgba(0, 0, 0, 0.12)$range-ios-knob-width28px26px -
ionChangeis no longer emitted when thevalueofion-rangeis modified externally.ionChangeis only emitted from user committed changes, such as dragging and releasing the range knob or selecting a new value with the keyboard arrows.- If your application requires immediate feedback based on the user actively dragging the range knob, consider migrating your event listeners to using
ionInputinstead.
- If your application requires immediate feedback based on the user actively dragging the range knob, consider migrating your event listeners to using
-
The
debounceproperty's value value has changed from0toundefined. Ifdebounceis undefined, theionInputevent will fire immediately. -
Range no longer clamps assigned values within bounds. Developers will need to validate the value they are assigning to
ion-rangeis within theminandmaxbounds when programmatically assigning a value. -
The
nameproperty defaults toion-r-${rangeIds++}whererangeIdsis a number that is incremented for every instance ofion-range.
Searchbar
-
ionChangeis no longer emitted when thevalueofion-searchbaris modified externally.ionChangeis only emitted from user committed changes, such as typing in the searchbar and the searchbar losing focus or pressing the "Enter" key.- If your application requires immediate feedback based on the user typing actively in the searchbar, consider migrating your event listeners to using
ionInputinstead.
- If your application requires immediate feedback based on the user typing actively in the searchbar, consider migrating your event listeners to using
-
The
debounceproperty has been updated to control the timing in milliseconds to delay the event emission of theionInputevent after each keystroke. Previously it would delay the event emission ofionChange. -
The
debounceproperty's default value has changed from 250 toundefined. Ifdebounceis undefined, theionInputevent will fire immediately. -
The
detailpayload for theionInputevent now contains an object with the currentvalueas well as the native event that triggeredionInput.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
--placeholder-opacity |
0.5 |
0.6 |
Segment
-
ionChangeis no longer emitted when thevalueofion-segmentis modified externally.ionChangeis only emitted from user committed changes, such as clicking a segment button or dragging to activate a segment button. -
The type signature of
valuesupportsstring | undefined. Previously the type signature wasstring | null | undefined.- Developers needing to clear the checked segment item should assign a value of
''instead ofnull.
- Developers needing to clear the checked segment item should assign a value of
Select
-
ionChangeis no longer emitted when thevalueofion-selectis modified externally.ionChangeis only emitted from user committed changes, such as confirming a selected option in the select's overlay. -
The
iconCSS Shadow Part now targets anion-iconcomponent.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
--placeholder-opacity |
0.33 |
0.6 |
Slides
ion-slides, ion-slide, and the IonicSwiper plugin have been removed from Ionic.
Developers using these components will need to migrate to using Swiper.js directly, optionally using the IonicSlides plugin. Guides for migration and usage are linked below:
Textarea
-
ionChangeis no longer emitted when thevalueofion-textareais modified externally.ionChangeis only emitted from user committed changes, such as typing in the textarea and the textarea losing focus.- If your application requires immediate feedback based on the user typing actively in the textarea, consider migrating your event listeners to using
ionInputinstead.
- If your application requires immediate feedback based on the user typing actively in the textarea, consider migrating your event listeners to using
-
The
debounceproperty has been updated to control the timing in milliseconds to delay the event emission of theionInputevent after each keystroke. Previously it would delay the event emission ofionChange. -
The
debounceproperty's default value has changed from0toundefined. Ifdebounceis undefined, theionInputevent will fire immediately. -
ionInputdispatches an event detail ofnullwhen the textarea is cleared as a result ofclear-on-edit="true". -
The
detailpayload for theionInputevent now contains an object with the currentvalueas well as the native event that triggeredionInput.
Design tokens
| Token | Previous Value | New Value |
|---|---|---|
--placeholder-opacity |
0.5 |
0.6 |
Toggle
-
ionChangeis no longer emitted when thecheckedproperty ofion-toggleis modified externally.ionChangeis only emitted from user committed changes, such as clicking the toggle to set it on or off. -
The
--backgroundand--background-checkedvariables have been renamed to--track-backgroundand--track-background-checked, respectively.
Virtual Scroll
ion-virtual-scroll has been removed from Ionic.
Developers using the component will need to migrate to a virtual scroll solution provided by their framework:
Any references to the virtual scroll types from @ionic/core have been removed. Please remove or replace these types: Cell, VirtualNode, CellType, NodeChange, HeaderFn, ItemHeightFn, FooterHeightFn, ItemRenderFn and DomRenderFn.
Types
Overlay Attribute Interfaces
ActionSheetAttributes, AlertAttributes, AlertTextareaAttributes, AlertInputAttributes, LoadingAttributes, ModalAttributes, PickerAttributes, PopoverAttributes, and ToastAttributes have been removed. Developers should use { [key: string]: any } instead.
JavaScript Frameworks
Angular
-
Angular v14 is now required to use
@ionic/angularand@ionic/angular-server. Upgrade your project to Angular v14 by following the Angular v14 update guide. -
nullvalues on form components will no longer be converted to the empty string ('') orfalse. This impactsion-checkbox,ion-datetime,ion-input,ion-radio,ion-radio-group,ion-range,ion-searchbar,ion-segment,ion-select,ion-textarea, andion-toggle. -
The dev-preview
environmentInjectorproperty has been removed fromion-tabsandion-router-outlet. Standalone component routing is now available without additional custom configuration. Remove theenvironmentInjectorproperty from yourion-tabsandion-router-outletcomponents.
React
@ionic/react and @ionic/react-router no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite.
Vue
@ionic/vue and @ionic/vue-router no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite.
Utilities
`hidden` attribute
The [hidden] attribute has been removed from Ionic's global stylesheet. The [hidden] attribute can continue to be used, but developers will get the native hidden implementation instead. The main difference is that the native implementation is easier to override using display than Ionic's implementation.
Developers can add the following CSS to their global stylesheet if they need the old behavior:
[hidden] {
display: none !important;
}
Version 6.x
Components
Datetime
The ion-datetime component has undergone a complete rewrite and uses a new calendar style. As a result, some of the properties no longer apply and have been removed.
-
ion-datetimenow displays the calendar inline by default, allowing for more flexibility in presentation. As a result, theplaceholderproperty has been removed. Additionally, thetextandplaceholderShadow Parts have been removed. -
The
--padding-bottom,--padding-end,--padding-start,--padding-top, and--placeholder-colorCSS Variables have been removed sinceion-datetimenow displays inline by default. -
The
displayFormatanddisplayTimezoneproperties have been removed sinceion-datetimenow displays inline with a calendar picker. To parse the UTC string provided in the payload of theionChangeevent, we recommend using a 3rd-party date library like date-fns. Here is an example of how you can take the UTC string fromion-datetimeand format it to whatever style you prefer:
import { format, parseISO } from 'date-fns';
/**
* This is provided in the event
* payload from the `ionChange` event.
*/
const dateFromIonDatetime = '2021-06-04T14:23:00-04:00';
const formattedString = format(parseISO(dateFromIonDatetime), 'MMM d, yyyy');
console.log(formattedString); // Jun 4, 2021
-
The
pickerOptionsandpickerFormatproperties have been removed sinceion-datetimenow uses a calendar style rather than a wheel picker style. -
The
monthNames,monthShortNames,dayNames, anddayShortNamesproperties have been removed.ion-datetimecan now automatically format these values according to your devices locale thanks to the Intl.DateTimeFormat API. If you wish to force a specific locale, you can use the newlocaleproperty:
<ion-datetime locale="fr-FR"></ion-datetime>
- The
openmethod has been removed. To present the datetime in an overlay, you can pass it into anion-modalorion-popovercomponent and call thepresentmethod on the overlay instance. Alternatively, you can use thetriggerproperty onion-modalorion-popoverto present the overlay on a button click:
<ion-button id="open-modal">Open Datetime Modal</ion-button>
<ion-modal trigger="open-modal">
<ion-datetime></ion-datetime>
</ion-modal>
Header
When using a collapsible large title, the last toolbar in the header with collapse="condense" no longer has a border. This does not affect the toolbar when the large title is collapsed.
To get the old style back, add the following CSS to your global stylesheet:
ion-header.header-collapse-condense ion-toolbar:last-of-type {
--border-width: 0 0 0.55px;
}
Icons
Ionic 6 now ships with Ionicons 6. Please be sure to review the Ionicons 6.0.0 Changelog and make any necessary changes.
Input
The placeholder property now has a type of string | undefined rather than null | string | undefined.
Modal
Converted ion-modal to use Shadow DOM.
If you were targeting the internals of ion-modal in your CSS, you will need to target the backdrop or content Shadow Parts instead, or use the provided CSS Variables.
Developers dynamically creating modals using document.createElement('ion-modal') will now need to call modal.remove() after the modal has been dismissed if they want the modal to be removed from the DOM.
Popover
Converted ion-popover to use Shadow DOM.
If you were targeting the internals of ion-popover in your CSS, you will need to target the backdrop, arrow, or content Shadow Parts instead, or use the provided CSS Variables.
Developers dynamically creating popovers using document.createElement('ion-popover') will now need to call popover.remove() after the popover has been dismissed if they want the popover to be removed from the DOM.
Radio
The RadioChangeEventDetail interface has been removed. Instead, listen for the ionChange event on ion-radio-group and use the RadioGroupChangeEventDetail interface.
Searchbar
The showClearButton property now defaults to 'always' for improved usability with screen readers.
To get the old behavior, set showClearButton to 'focus'.
Select
The placeholder property now has a type of string | undefined rather than null | string | undefined.
Tab Bar
The default iOS tab bar background color has been updated to better reflect the latest iOS styles. The new default value is:
var(--ion-tab-bar-background, var(--ion-color-step-50, #f7f7f7));
Textarea
The placeholder property now has a type of string | undefined rather than null | string | undefined.
Toast
The --white-space CSS variable now defaults to normal instead of pre-wrap.
Toolbar
The default iOS toolbar background color has been updated to better reflect the latest iOS styles. The new default value is:
var(--ion-toolbar-background, var(--ion-color-step-50, #f7f7f7));
Config
Transition Shadow
The experimentalTransitionShadow config option has been removed. The transition shadow is now enabled when running in ios mode.
Angular
Config
The Config.set() method has been removed. See https://ionicframework.com/docs/angular/config for examples on how to set config globally, per-component, and per-platform.
Additionally, the setupConfig function is no longer exported from @ionic/angular. Developers should use IonicModule.forRoot to set the config instead. See https://ionicframework.com/docs/angular/config for more information.
React
Config
All Ionic React applications must now import setupIonicReact from @ionic/react and call it. If you are setting a custom config with setupConfig, pass your config directly to setupIonicReact instead:
Old
import { setupConfig } from '@ionic/react';
setupConfig({
mode: 'md'
})
New
import { setupIonicReact } from '@ionic/react';
setupIonicReact({
mode: 'md'
})
Note that all Ionic React applications must call setupIonicReact even if they are not setting custom configuration.
Additionally, the setupConfig function is no longer exported from @ionic/react.
Vue
Config
The setupConfig function is no longer exported from @ionic/vue. Developers should pass their config into the IonicVue plugin. See https://ionicframework.com/docs/vue/config for more information.
Tabs Config
Support for child routes nested inside of tabs has been removed to better conform to Vue Router's best practices. Additional routes should be written as sibling routes with the parent tab as the path prefix:
Old
const routes: Array<RouteRecordRaw> = [
{
path: '/',
redirect: '/tabs/tab1'
},
{
path: '/tabs/',
component: Tabs,
children: [
{
path: '',
redirect: 'tab1'
},
{
path: 'tab1',
component: () => import('@/views/Tab1.vue'),
children: {
{
path: 'view',
component: () => import('@/views/Tab1View.vue')
}
}
},
{
path: 'tab2',
component: () => import('@/views/Tab2.vue')
},
{
path: 'tab3',
component: () => import('@/views/Tab3.vue')
}
]
}
]
New
const routes: Array<RouteRecordRaw> = [
{
path: '/',
redirect: '/tabs/tab1'
},
{
path: '/tabs/',
component: Tabs,
children: [
{
path: '',
redirect: 'tab1'
},
{
path: 'tab1',
component: () => import('@/views/Tab1.vue')
},
{
path: 'tab1/view',
component: () => import('@/views/Tab1View.vue')
},
{
path: 'tab2',
component: () => import('@/views/Tab2.vue')
},
{
path: 'tab3',
component: () => import('@/views/Tab3.vue')
}
]
}
]
In the example above tabs/tab1/view has been rewritten has a sibling route to tabs/tab1. The path field now includes the tab1 prefix.
Tabs Router Outlet
Developers must now provide an ion-router-outlet inside of ion-tabs. Previously one was generated automatically, but this made it difficult for developers to access the properties on the generated ion-router-outlet.
Old
<ion-tabs>
<ion-tab-bar slot="bottom">
...
</ion-tab-bar>
</ion-tabs>
<script>
import { IonTabs, IonTabBar } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonTabs, IonTabBar }
});
</script>
New
<ion-tabs>
<ion-router-outlet></ion-router-outlet>
<ion-tab-bar slot="bottom">
...
</ion-tab-bar>
</ion-tabs>
<script>
import { IonTabs, IonTabBar, IonRouterOutlet } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonTabs, IonTabBar, IonRouterOutlet }
});
</script>
Overlay Events
Overlay events onWillPresent, onDidPresent, onWillDismiss, and onDidDismiss have been removed in favor of willPresent, didPresent, willDismiss, and didDismiss.
This applies to the following components: ion-action-sheet, ion-alert, ion-loading, ion-modal, ion-picker, ion-popover, and ion-toast.
Old
<ion-modal
:is-open="modalOpenRef"
@onWillPresent="onModalWillPresentHandler"
@onDidPresent="onModalDidPresentHandler"
@onWillDismiss="onModalWillDismissHandler"
@onDidDismiss="onModalDidDismissHandler"
>
...
</ion-modal>
New
<ion-modal
:is-open="modalOpenRef"
@willPresent="onModalWillPresentHandler"
@didPresent="onModalDidPresentHandler"
@willDismiss="onModalWillDismissHandler"
@didDismiss="onModalDidDismissHandler"
>
...
</ion-modal>
Utility Function Types
-
The
IonRoutertype foruseIonRouterhas been renamed toUseIonRouterResult. -
The
IonKeyboardReftype foruseKeyboardhas been renamed toUseKeyboardResult.
Browser and Platform Support
This section details the desktop browser, JavaScript framework, and mobile platform versions that are supported by Ionic Framework v6.
Minimum Browser Versions
| Desktop Browser | Supported Versions |
|---|---|
| Chrome | 60+ |
| Safari | 13+ |
| Firefox | 63+ |
| Edge | 79+ |
Minimum JavaScript Framework Versions
| Framework | Supported Version |
|---|---|
| Angular | 12+ |
| React | 17+ |
| Vue | 3.0.6+ |
Minimum Mobile Platform Versions
| Platform | Supported Version |
|---|---|
| iOS | 13+ |
| Android | 5.0+ with Chromium 60+ (See note below) |
Starting with Android 5.0, the webview was moved to a separate application that can be updated independently of Android. This means that most Android 5.0+ devices are going to be running a modern version of Chromium. However, there are a still a subset of Android devices whose manufacturer has locked the webview version and does not allow the webview to update. These webviews are typically stuck at the version that was available when the device initially shipped.
As a result, Ionic Framework only supports Android devices and emulators running Android 5.0+ with a webview of Chromium 60 or newer. For context, this is the version that Stencil can support with no polyfills: https://stenciljs.com/docs/browser-support