Skip to content

Commit 96f3017

Browse files
chore(git): merge feature-8.5 into main
2 parents 0296ebe + 0ba7b74 commit 96f3017

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2074
-0
lines changed

docs/api/checkbox.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ import LabelLink from '@site/static/usage/v8/checkbox/label-link/index.md';
7474

7575
<LabelLink />
7676

77+
## Helper & Error Text
78+
79+
Helper and error text can be used inside of a checkbox with the `helperText` and `errorText` property. The error text will not be displayed unless the `ion-invalid` and `ion-touched` classes are added to the `ion-checkbox`. This ensures errors are not shown before the user has a chance to enter data.
80+
81+
In Angular, this is done automatically through form validation. In JavaScript, React and Vue, the class needs to be manually added based on your own validation.
82+
83+
import HelperError from '@site/static/usage/v8/checkbox/helper-error/index.md';
84+
85+
<HelperError />
86+
7787
## Theming
7888

7989
### CSS Custom Properties

docs/api/modal.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ import SheetHandleBehaviorExample from '@site/static/usage/v8/modal/sheet/handle
157157

158158
<SheetHandleBehaviorExample />
159159

160+
### Scrolling content at all breakpoints
161+
162+
Sheet modals can be configured to allow scrolling content at all breakpoints, making them ideal for displaying content larger than the viewport. By setting the `expandToScroll` property to `false`, the content remains scrollable at every breakpoint. Otherwise, by default, scrolling is only enabled when the sheet modal is fully expanded.
163+
164+
import SheetScrollingContentExample from '@site/static/usage/v8/modal/sheet/expand-to-scroll/index.md';
165+
166+
<SheetScrollingContentExample />
167+
160168
## Styling
161169

162170
Modals are presented at the root of your application so they overlay your entire app. This behavior applies to both inline modals and modals presented from a controller. As a result, custom modal styles can not be scoped to a particular component as they will not apply to the modal. Instead, styles must be applied globally. For most developers, placing the custom styles in `global.css` is sufficient.

docs/api/radio.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ import EmptySelection from '@site/static/usage/v8/radio/empty-selection/index.md
7676

7777
<EmptySelection />
7878

79+
## Helper & Error Text
80+
81+
Helper and error text can be used inside of a radio group with the `helperText` and `errorText` property. The error text will not be displayed unless the `ion-invalid` and `ion-touched` classes are added to the `ion-radio-group`. This ensures errors are not shown before the user has a chance to enter data.
82+
83+
In Angular, this is done automatically through form validation. In JavaScript, React and Vue, the class needs to be manually added based on your own validation.
84+
85+
import HelperError from '@site/static/usage/v8/radio/helper-error/index.md';
86+
87+
<HelperError />
88+
7989

8090
## Theming
8191

docs/api/select.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@ import TypeaheadExample from '@site/static/usage/v8/select/typeahead/index.md';
253253

254254
<TypeaheadExample />
255255

256+
## Helper & Error Text
257+
258+
Helper and error text can be used inside of a select with the `helperText` and `errorText` property. The error text will not be displayed unless the `ion-invalid` and `ion-touched` classes are added to the `ion-select`. This ensures errors are not shown before the user has a chance to enter data.
259+
260+
In Angular, this is done automatically through form validation. In JavaScript, React and Vue, the class needs to be manually added based on your own validation.
261+
262+
import HelperError from '@site/static/usage/v8/select/helper-error/index.md';
263+
264+
<HelperError />
265+
256266
## Interfaces
257267

258268
### SelectChangeEventDetail

docs/api/toggle.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ import Justify from '@site/static/usage/v8/toggle/justify/index.md';
7373

7474
<Justify />
7575

76+
## Helper & Error Text
77+
78+
Helper and error text can be used inside of a toggle with the `helperText` and `errorText` property. The error text will not be displayed unless the `ion-invalid` and `ion-touched` classes are added to the `ion-toggle`. This ensures errors are not shown before the user has a chance to enter data.
79+
80+
In Angular, this is done automatically through form validation. In JavaScript, React and Vue, the class needs to be manually added based on your own validation.
81+
82+
import HelperError from '@site/static/usage/v8/toggle/helper-error/index.md';
83+
84+
<HelperError />
85+
7686
## Theming
7787

7888
### Colors

docs/developing/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ Below are the config options that Ionic uses.
178178
| `loadingEnter` | `AnimationBuilder` | Provides a custom enter animation for all `ion-loading`, overriding the default "animation". |
179179
| `loadingLeave` | `AnimationBuilder` | Provides a custom leave animation for all `ion-loading`, overriding the default "animation". |
180180
| `loadingSpinner` | `SpinnerTypes` | Overrides the default spinner for all `ion-loading` overlays. |
181+
| `logLevel` | `'OFF' \| 'ERROR' \| 'WARN'` | Configures the logging level for Ionic Framework. If `'OFF'`, no errors or warnings are logged. If `'ERROR'`, only errors are logged. If `'WARN'`, errors and warnings are logged. |
181182
| `menuIcon` | `string` | Overrides the default icon in all `<ion-menu-button>` components. |
182183
| `menuType` | `string` | Overrides the default menu type for all `<ion-menu>` components. |
183184
| `modalEnter` | `AnimationBuilder` | Provides a custom enter animation for all `ion-modal`, overriding the default "animation". |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```html
2+
<form [formGroup]="myForm" (ngSubmit)="onSubmit()">
3+
<ion-checkbox
4+
formControlName="agree"
5+
helperText="Agree to the terms before continuing"
6+
errorText="You must agree to the terms to continue"
7+
>
8+
I agree to the terms and conditions
9+
</ion-checkbox>
10+
11+
<br />
12+
13+
<ion-button type="submit" size="small">Submit</ion-button>
14+
</form>
15+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
4+
import { IonCheckbox, IonButton } from '@ionic/angular/standalone';
5+
6+
@Component({
7+
selector: 'app-example',
8+
standalone: true,
9+
imports: [IonCheckbox, IonButton, ReactiveFormsModule],
10+
templateUrl: './example.component.html',
11+
styleUrl: './example.component.css',
12+
})
13+
export class ExampleComponent {
14+
myForm: FormGroup;
15+
16+
constructor(private fb: FormBuilder) {
17+
this.myForm = this.fb.group({
18+
agree: [false, Validators.requiredTrue],
19+
});
20+
}
21+
22+
onSubmit() {
23+
// Mark the control as touched to trigger the error message.
24+
// This is needed if the user submits the form without interacting
25+
// with the checkbox.
26+
this.myForm.get('agree')!.markAsTouched();
27+
}
28+
}
29+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Input</title>
7+
<link rel="stylesheet" href="../../common.css" />
8+
<script src="../../common.js"></script>
9+
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@8/dist/ionic/ionic.esm.js"></script>
10+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@8/css/ionic.bundle.css" />
11+
</head>
12+
13+
<body>
14+
<div class="container">
15+
<form id="my-form">
16+
<ion-checkbox
17+
helper-text="Agree to the terms before continuing"
18+
error-text="You must agree to the terms to continue"
19+
>
20+
I agree to the terms and conditions
21+
</ion-checkbox>
22+
23+
<br />
24+
25+
<ion-button type="submit" size="small">Submit</ion-button>
26+
</form>
27+
</div>
28+
29+
<script>
30+
const form = document.getElementById('my-form');
31+
const agree = form.querySelector('ion-checkbox');
32+
33+
form.addEventListener('submit', (event) => submit(event));
34+
agree.addEventListener('ionChange', (event) => validateCheckbox(event));
35+
36+
const validateCheckbox = (event) => {
37+
agree.classList.add('ion-touched');
38+
39+
if (!event.detail.checked) {
40+
agree.classList.add('ion-invalid');
41+
agree.classList.remove('ion-valid');
42+
} else {
43+
agree.classList.remove('ion-invalid');
44+
agree.classList.add('ion-valid');
45+
}
46+
};
47+
48+
const submit = (event) => {
49+
event.preventDefault();
50+
51+
validateCheckbox({ detail: { checked: agree.checked } });
52+
};
53+
</script>
54+
</body>
55+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Playground from '@site/src/components/global/Playground';
2+
3+
import javascript from './javascript.md';
4+
import react from './react.md';
5+
import vue from './vue.md';
6+
7+
import angular_example_component_html from './angular/example_component_html.md';
8+
import angular_example_component_ts from './angular/example_component_ts.md';
9+
10+
<Playground
11+
version="8"
12+
code={{
13+
javascript,
14+
react,
15+
vue,
16+
angular: {
17+
files: {
18+
'src/app/example.component.html': angular_example_component_html,
19+
'src/app/example.component.ts': angular_example_component_ts,
20+
},
21+
},
22+
}}
23+
src="usage/v8/checkbox/helper-error/demo.html"
24+
/>

0 commit comments

Comments
 (0)