You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(datetime): remove ion-buttons to fix CSP violations (#30770)
Issue number: N/A
---------
## What is the current behavior?
The Datetime component breaks CSP rules due to the following:
1. Datetime is using `ion-buttons` which uses `scoped` encapsulation.
2. When using the `ionic` theme, it imports Phosphor icons as data URIs, which are blocked by `connect-src 'self' blob:`.
## What is the new behavior?
- Remove all usages of `ion-buttons`, removing the dependency on a scoped component
- Updates the styling to account for the removal of `ion-buttons`
- Updates `ion-button` to change its styles based on being inside of an `ion-datetime`
Phosphor icons have not been removed because there is a workaround for it and we will remove its usage across all components in future work.
## Does this introduce a breaking change?
- [x] Yes
- [ ] No
This shouldn't cause breaking changes but because we are no longer recommending users use `ion-buttons` with custom buttons I am marking it as a breaking change.
BREAKING CHANGE:
The `ion-buttons` component has been removed from the internal implementation of `ion-datetime` and is no longer required when passing custom buttons to the `slot="buttons"`. When providing custom buttons, use a `div` element instead of `ion-buttons`. While existing code using `ion-buttons` may continue to work visually, future updates to the `ion-buttons` component may cause any styles you rely on to break.
---------
Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
Copy file name to clipboardExpand all lines: BREAKING.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
18
18
-[Button](#version-9x-button)
19
19
-[Card](#version-9x-card)
20
20
-[Chip](#version-9x-chip)
21
+
-[Datetime](#version-9x-datetime)
21
22
-[Grid](#version-9x-grid)
22
23
23
24
<h2id="version-9x-components">Components</h2>
@@ -62,6 +63,10 @@ This is a comprehensive list of the breaking changes introduced in the major ver
62
63
63
64
- The `border-radius` of the `ios` and `md` chip now defaults to `10px` and `8px`, respectively, instead of `16px` in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"round"`, or override the `--border-radius` CSS variable to specify a different value.
64
65
66
+
<h4id="version-9x-datetime">Datetime</h4>
67
+
68
+
- The `ion-buttons` component has been removed from the internal implementation of `ion-datetime` and is no longer required when passing custom buttons to the `slot="buttons"`. When providing custom buttons, use a `div` element instead of `ion-buttons`. While existing code using `ion-buttons` may continue to work visually, future updates to the `ion-buttons` component may cause any styles you rely on to break.
69
+
65
70
<h4id="version-9x-grid">Grid</h4>
66
71
67
72
- The properties `pull` and `push` have been deprecated and no longer work. A similar look can be achieved with the newly added property `order`.
Copy file name to clipboardExpand all lines: core/src/components.d.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -600,7 +600,7 @@ export namespace Components {
600
600
*/
601
601
"expand"?: 'full' | 'block';
602
602
/**
603
-
* Set to `"clear"` for a transparent button that resembles a flat button, to `"outline"` for a transparent button with a border, or to `"solid"` for a button with a filled background. The default fill is `"solid"` except inside of a toolbar, where the default is `"clear"`.
603
+
* Set to `"clear"` for a transparent button that resembles a flat button, to `"outline"` for a transparent button with a border, or to `"solid"` for a button with a filled background. The default fill is `"solid"` except when inside of a buttons or datetime component, where the default fill is `"clear"`.
* Set to `"clear"` for a transparent button that resembles a flat button, to `"outline"` for a transparent button with a border, or to `"solid"` for a button with a filled background. The default fill is `"solid"` except inside of a toolbar, where the default is `"clear"`.
6558
+
* Set to `"clear"` for a transparent button that resembles a flat button, to `"outline"` for a transparent button with a border, or to `"solid"` for a button with a filled background. The default fill is `"solid"` except when inside of a buttons or datetime component, where the default fill is `"clear"`.
0 commit comments