Skip to content

Commit dc2f55f

Browse files
committed
chore: sync with main
2 parents f806781 + 895bcb0 commit dc2f55f

35 files changed

+392
-166
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [7.4.4](https://github.com/ionic-team/ionic-framework/compare/v7.4.3...v7.4.4) (2023-10-11)
7+
8+
9+
### Bug Fixes
10+
11+
* **animation:** play method resolves when animation is stopped ([#28264](https://github.com/ionic-team/ionic-framework/issues/28264)) ([e6031fb](https://github.com/ionic-team/ionic-framework/commit/e6031fbef0698dac0a346cd6202c47f2abf54f95))
12+
* **checkbox, radio, toggle:** disabled elements are not interactive ([#28294](https://github.com/ionic-team/ionic-framework/issues/28294)) ([c70432e](https://github.com/ionic-team/ionic-framework/commit/c70432e6934bcf1d570e1f7cf671c52d2bb52a8b)), closes [#28293](https://github.com/ionic-team/ionic-framework/issues/28293)
13+
* **content:** fullscreen offset is computed correctly with tab bar ([#28245](https://github.com/ionic-team/ionic-framework/issues/28245)) ([7375dd6](https://github.com/ionic-team/ionic-framework/commit/7375dd6abafdf7457f23deb53ad5f016456a6af2)), closes [#21130](https://github.com/ionic-team/ionic-framework/issues/21130)
14+
* **core:** allow fullscreen scroll content to flow outside container for translucent tab bar ([#28246](https://github.com/ionic-team/ionic-framework/issues/28246)) ([b297529](https://github.com/ionic-team/ionic-framework/commit/b297529afc4b93a93f7eaecd31dd5a88a3de5f4e)), closes [#17676](https://github.com/ionic-team/ionic-framework/issues/17676)
15+
* **core:** swipe to go back gesture has priority over other horizontal swipe gestures ([#28304](https://github.com/ionic-team/ionic-framework/issues/28304)) ([d5f0c77](https://github.com/ionic-team/ionic-framework/commit/d5f0c776dfb5cb40b8119c596805dad3adb621e0)), closes [#28303](https://github.com/ionic-team/ionic-framework/issues/28303)
16+
* **header:** collapsible large title main header does not flicker on load ([#28277](https://github.com/ionic-team/ionic-framework/issues/28277)) ([3259da0](https://github.com/ionic-team/ionic-framework/commit/3259da0de181c8f82c38d9de13733213c77d398f)), closes [#27060](https://github.com/ionic-team/ionic-framework/issues/27060)
17+
* **menu:** do not error if disabled or swipeGesture is changed mid-animation ([#28268](https://github.com/ionic-team/ionic-framework/issues/28268)) ([a169044](https://github.com/ionic-team/ionic-framework/commit/a1690441e5bcee8176da32700de6f9e3fde9635e)), closes [#20092](https://github.com/ionic-team/ionic-framework/issues/20092) [#19676](https://github.com/ionic-team/ionic-framework/issues/19676) [#19000](https://github.com/ionic-team/ionic-framework/issues/19000)
18+
* **segment:** scroll to active segment-button on first load ([#28276](https://github.com/ionic-team/ionic-framework/issues/28276)) ([1167a93](https://github.com/ionic-team/ionic-framework/commit/1167a9325fb930b6c727bc26889f5488d9620062)), closes [#28096](https://github.com/ionic-team/ionic-framework/issues/28096)
19+
20+
21+
22+
23+
624
## [7.4.3](https://github.com/ionic-team/ionic-framework/compare/v7.4.2...v7.4.3) (2023-10-04)
725

826

core/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [7.4.4](https://github.com/ionic-team/ionic-framework/compare/v7.4.3...v7.4.4) (2023-10-11)
7+
8+
9+
### Bug Fixes
10+
11+
* **animation:** play method resolves when animation is stopped ([#28264](https://github.com/ionic-team/ionic-framework/issues/28264)) ([e6031fb](https://github.com/ionic-team/ionic-framework/commit/e6031fbef0698dac0a346cd6202c47f2abf54f95))
12+
* **checkbox, radio, toggle:** disabled elements are not interactive ([#28294](https://github.com/ionic-team/ionic-framework/issues/28294)) ([c70432e](https://github.com/ionic-team/ionic-framework/commit/c70432e6934bcf1d570e1f7cf671c52d2bb52a8b)), closes [#28293](https://github.com/ionic-team/ionic-framework/issues/28293)
13+
* **content:** fullscreen offset is computed correctly with tab bar ([#28245](https://github.com/ionic-team/ionic-framework/issues/28245)) ([7375dd6](https://github.com/ionic-team/ionic-framework/commit/7375dd6abafdf7457f23deb53ad5f016456a6af2)), closes [#21130](https://github.com/ionic-team/ionic-framework/issues/21130)
14+
* **core:** allow fullscreen scroll content to flow outside container for translucent tab bar ([#28246](https://github.com/ionic-team/ionic-framework/issues/28246)) ([b297529](https://github.com/ionic-team/ionic-framework/commit/b297529afc4b93a93f7eaecd31dd5a88a3de5f4e)), closes [#17676](https://github.com/ionic-team/ionic-framework/issues/17676)
15+
* **core:** swipe to go back gesture has priority over other horizontal swipe gestures ([#28304](https://github.com/ionic-team/ionic-framework/issues/28304)) ([d5f0c77](https://github.com/ionic-team/ionic-framework/commit/d5f0c776dfb5cb40b8119c596805dad3adb621e0)), closes [#28303](https://github.com/ionic-team/ionic-framework/issues/28303)
16+
* **header:** collapsible large title main header does not flicker on load ([#28277](https://github.com/ionic-team/ionic-framework/issues/28277)) ([3259da0](https://github.com/ionic-team/ionic-framework/commit/3259da0de181c8f82c38d9de13733213c77d398f)), closes [#27060](https://github.com/ionic-team/ionic-framework/issues/27060)
17+
* **menu:** do not error if disabled or swipeGesture is changed mid-animation ([#28268](https://github.com/ionic-team/ionic-framework/issues/28268)) ([a169044](https://github.com/ionic-team/ionic-framework/commit/a1690441e5bcee8176da32700de6f9e3fde9635e)), closes [#20092](https://github.com/ionic-team/ionic-framework/issues/20092) [#19676](https://github.com/ionic-team/ionic-framework/issues/19676) [#19000](https://github.com/ionic-team/ionic-framework/issues/19000)
18+
* **segment:** scroll to active segment-button on first load ([#28276](https://github.com/ionic-team/ionic-framework/issues/28276)) ([1167a93](https://github.com/ionic-team/ionic-framework/commit/1167a9325fb930b6c727bc26889f5488d9620062)), closes [#28096](https://github.com/ionic-team/ionic-framework/issues/28096)
19+
20+
21+
22+
23+
624
## [7.4.3](https://github.com/ionic-team/ionic-framework/compare/v7.4.2...v7.4.3) (2023-10-04)
725

826

core/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/core",
3-
"version": "7.4.3",
3+
"version": "7.4.4",
44
"description": "Base components for Ionic",
55
"keywords": [
66
"ionic",
@@ -31,7 +31,7 @@
3131
"loader/"
3232
],
3333
"dependencies": {
34-
"@stencil/core": "^4.4.0",
34+
"@stencil/core": "^4.4.1",
3535
"ionicons": "^7.2.1",
3636
"tslib": "^2.1.0"
3737
},

core/src/components/checkbox/checkbox.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ export class Checkbox implements ComponentInterface {
211211
};
212212

213213
private onClick = (ev: MouseEvent) => {
214+
if (this.disabled) {
215+
return;
216+
}
217+
214218
this.toggleChecked(ev);
215219
};
216220

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { newSpecPage } from '@stencil/core/testing';
2+
3+
import { Checkbox } from '../checkbox';
4+
5+
describe('ion-checkbox: disabled', () => {
6+
it('clicking disabled checkbox should not toggle checked state', async () => {
7+
const page = await newSpecPage({
8+
components: [Checkbox],
9+
html: `
10+
<ion-checkbox disabled="true">Checkbox</ion-checkbox>
11+
`,
12+
});
13+
14+
const checkbox = page.body.querySelector('ion-checkbox');
15+
16+
expect(checkbox.checked).toBe(false);
17+
18+
checkbox.click();
19+
20+
await page.waitForChanges();
21+
22+
expect(checkbox.checked).toBe(false);
23+
});
24+
});

core/src/components/radio-group/radio-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class RadioGroup implements ComponentInterface {
113113
* using the `name` attribute.
114114
*/
115115
const selectedRadio = ev.target && (ev.target as HTMLElement).closest('ion-radio');
116-
if (selectedRadio) {
116+
if (selectedRadio && selectedRadio.disabled === false) {
117117
const currentValue = this.value;
118118
const newValue = selectedRadio.value;
119119
if (newValue !== currentValue) {

core/src/components/radio/radio.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ export class Radio implements ComponentInterface {
200200
};
201201

202202
private onClick = () => {
203-
const { radioGroup, checked } = this;
203+
const { radioGroup, checked, disabled } = this;
204+
205+
if (disabled) {
206+
return;
207+
}
204208

205209
/**
206210
* The legacy control uses a native input inside

core/src/components/radio/test/radio.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,27 @@ describe('ion-radio', () => {
3131
expect(radio.classList.contains('radio-checked')).toBe(true);
3232
});
3333
});
34+
35+
describe('ion-radio: disabled', () => {
36+
it('clicking disabled radio should not set checked state', async () => {
37+
const page = await newSpecPage({
38+
components: [Radio, RadioGroup],
39+
html: `
40+
<ion-radio-group>
41+
<ion-radio disabled="true" value="a">Radio</ion-radio>
42+
</ion-radio-group>
43+
`,
44+
});
45+
46+
const radio = page.body.querySelector('ion-radio');
47+
const radioGroup = page.body.querySelector('ion-radio-group');
48+
49+
expect(radioGroup.value).toBe(undefined);
50+
51+
radio.click();
52+
53+
await page.waitForChanges();
54+
55+
expect(radioGroup.value).toBe(undefined);
56+
});
57+
});

core/src/components/select/select.tsx

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -316,29 +316,46 @@ export class Select implements ComponentInterface {
316316

317317
// focus selected option for popovers
318318
if (this.interface === 'popover') {
319-
let indexOfSelected = this.childOpts.map((o) => o.value).indexOf(this.value);
320-
indexOfSelected = indexOfSelected > -1 ? indexOfSelected : 0; // default to first option if nothing selected
321-
const selectedItem = overlay.querySelector<HTMLElement>(
322-
`.select-interface-option:nth-child(${indexOfSelected + 1})`
323-
);
319+
const indexOfSelected = this.childOpts.map((o) => o.value).indexOf(this.value);
324320

325-
if (selectedItem) {
326-
focusElement(selectedItem);
321+
if (indexOfSelected > -1) {
322+
const selectedItem = overlay.querySelector<HTMLElement>(
323+
`.select-interface-option:nth-child(${indexOfSelected + 1})`
324+
);
327325

326+
if (selectedItem) {
327+
focusElement(selectedItem);
328+
329+
/**
330+
* Browsers such as Firefox do not
331+
* correctly delegate focus when manually
332+
* focusing an element with delegatesFocus.
333+
* We work around this by manually focusing
334+
* the interactive element.
335+
* ion-radio and ion-checkbox are the only
336+
* elements that ion-select-popover uses, so
337+
* we only need to worry about those two components
338+
* when focusing.
339+
*/
340+
const interactiveEl = selectedItem.querySelector<HTMLElement>('ion-radio, ion-checkbox');
341+
if (interactiveEl) {
342+
interactiveEl.focus();
343+
}
344+
}
345+
} else {
328346
/**
329-
* Browsers such as Firefox do not
330-
* correctly delegate focus when manually
331-
* focusing an element with delegatesFocus.
332-
* We work around this by manually focusing
333-
* the interactive element.
334-
* ion-radio and ion-checkbox are the only
335-
* elements that ion-select-popover uses, so
336-
* we only need to worry about those two components
337-
* when focusing.
347+
* If no value is set then focus the first enabled option.
338348
*/
339-
const interactiveEl = selectedItem.querySelector<HTMLElement>('ion-radio, ion-checkbox');
340-
if (interactiveEl) {
341-
interactiveEl.focus();
349+
const firstEnabledOption = overlay.querySelector<HTMLElement>(
350+
'ion-radio:not(.radio-disabled), ion-checkbox:not(.checkbox-disabled)'
351+
);
352+
if (firstEnabledOption) {
353+
focusElement(firstEnabledOption.closest('ion-item')!);
354+
355+
/**
356+
* Focus the option for the same reason as we do above.
357+
*/
358+
firstEnabledOption.focus();
342359
}
343360
}
344361
}

0 commit comments

Comments
 (0)