Skip to content

Commit 875cc38

Browse files
committed
Merge branch 'main' of github.com:ionic-team/ionic-framework into FW-6256
2 parents d674ad1 + 23b7a29 commit 875cc38

Some content is hidden

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

48 files changed

+1044
-447
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
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+
## [8.5.2](https://github.com/ionic-team/ionic-framework/compare/v8.5.1...v8.5.2) (2025-03-26)
7+
8+
9+
### Bug Fixes
10+
11+
* **datetime:** support typing time values in a 24-hour format ([#30147](https://github.com/ionic-team/ionic-framework/issues/30147)) ([ac6e6a0](https://github.com/ionic-team/ionic-framework/commit/ac6e6a03174263d09ec55c9742a026862a3df444)), closes [#28877](https://github.com/ionic-team/ionic-framework/issues/28877)
12+
* **range:** emit ionInput when value changes ([#30293](https://github.com/ionic-team/ionic-framework/issues/30293)) ([7789bb5](https://github.com/ionic-team/ionic-framework/commit/7789bb59ee5c76074ff4872dc6a50ae2d83df8f5)), closes [#29619](https://github.com/ionic-team/ionic-framework/issues/29619)
13+
* **segment-button:** ensure consistent disabled state for segment-content error handling ([#30288](https://github.com/ionic-team/ionic-framework/issues/30288)) ([1cfa915](https://github.com/ionic-team/ionic-framework/commit/1cfa915e8fe362951c521bce970a9f5f10918ab2))
14+
15+
16+
17+
18+
619
## [8.5.1](https://github.com/ionic-team/ionic-framework/compare/v8.5.0...v8.5.1) (2025-03-19)
720

821

core/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
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+
## [8.5.2](https://github.com/ionic-team/ionic-framework/compare/v8.5.1...v8.5.2) (2025-03-26)
7+
8+
9+
### Bug Fixes
10+
11+
* **datetime:** support typing time values in a 24-hour format ([#30147](https://github.com/ionic-team/ionic-framework/issues/30147)) ([ac6e6a0](https://github.com/ionic-team/ionic-framework/commit/ac6e6a03174263d09ec55c9742a026862a3df444)), closes [#28877](https://github.com/ionic-team/ionic-framework/issues/28877)
12+
* **range:** emit ionInput when value changes ([#30293](https://github.com/ionic-team/ionic-framework/issues/30293)) ([7789bb5](https://github.com/ionic-team/ionic-framework/commit/7789bb59ee5c76074ff4872dc6a50ae2d83df8f5)), closes [#29619](https://github.com/ionic-team/ionic-framework/issues/29619)
13+
* **segment-button:** ensure consistent disabled state for segment-content error handling ([#30288](https://github.com/ionic-team/ionic-framework/issues/30288)) ([1cfa915](https://github.com/ionic-team/ionic-framework/commit/1cfa915e8fe362951c521bce970a9f5f10918ab2))
14+
15+
16+
17+
18+
619
## [8.5.1](https://github.com/ionic-team/ionic-framework/compare/v8.5.0...v8.5.1) (2025-03-19)
720

821

core/package-lock.json

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

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/core",
3-
"version": "8.5.1",
3+
"version": "8.5.2",
44
"description": "Base components for Ionic",
55
"keywords": [
66
"ionic",

core/src/components/datetime/datetime.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ export class Datetime implements ComponentInterface {
19841984
});
19851985

19861986
this.setActiveParts({
1987-
...activePart,
1987+
...this.getActivePartsWithFallback(),
19881988
hour: ev.detail.value,
19891989
});
19901990

@@ -2024,7 +2024,7 @@ export class Datetime implements ComponentInterface {
20242024
});
20252025

20262026
this.setActiveParts({
2027-
...activePart,
2027+
...this.getActivePartsWithFallback(),
20282028
minute: ev.detail.value,
20292029
});
20302030

@@ -2070,7 +2070,7 @@ export class Datetime implements ComponentInterface {
20702070
});
20712071

20722072
this.setActiveParts({
2073-
...activePart,
2073+
...this.getActivePartsWithFallback(),
20742074
ampm: ev.detail.value,
20752075
hour,
20762076
});

core/src/components/picker/picker.tsx

Lines changed: 65 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,72 @@ export class Picker implements ComponentInterface {
410410
colEl: HTMLIonPickerColumnElement,
411411
value: string,
412412
zeroBehavior: 'start' | 'end' = 'start'
413-
) => {
413+
): boolean => {
414+
if (!value) {
415+
return false;
416+
}
417+
414418
const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
419+
value = value.replace(behavior, '');
415420
const option = Array.from(colEl.querySelectorAll('ion-picker-column-option')).find((el) => {
416421
return el.disabled !== true && el.textContent!.replace(behavior, '') === value;
417422
});
418423

419424
if (option) {
420425
colEl.setValue(option.value);
421426
}
427+
428+
return !!option;
429+
};
430+
431+
/**
432+
* Attempts to intelligently search the first and second
433+
* column as if they're number columns for the provided numbers
434+
* where the first two numbers are the first column
435+
* and the last 2 are the last column. Tries to allow for the first
436+
* number to be ignored for situations where typos occurred.
437+
*/
438+
private multiColumnSearch = (
439+
firstColumn: HTMLIonPickerColumnElement,
440+
secondColumn: HTMLIonPickerColumnElement,
441+
input: string
442+
) => {
443+
if (input.length === 0) {
444+
return;
445+
}
446+
447+
const inputArray = input.split('');
448+
const hourValue = inputArray.slice(0, 2).join('');
449+
// Try to find a match for the first two digits in the first column
450+
const foundHour = this.searchColumn(firstColumn, hourValue);
451+
452+
// If we have more than 2 digits and found a match for hours,
453+
// use the remaining digits for the second column (minutes)
454+
if (inputArray.length > 2 && foundHour) {
455+
const minuteValue = inputArray.slice(2, 4).join('');
456+
this.searchColumn(secondColumn, minuteValue);
457+
}
458+
// If we couldn't find a match for the two-digit hour, try single digit approaches
459+
else if (!foundHour && inputArray.length >= 1) {
460+
// First try the first digit as a single-digit hour
461+
let singleDigitHour = inputArray[0];
462+
let singleDigitFound = this.searchColumn(firstColumn, singleDigitHour);
463+
464+
// If that didn't work, try the second digit as a single-digit hour
465+
// (handles case where user made a typo in the first digit, or they typed over themselves)
466+
if (!singleDigitFound) {
467+
inputArray.shift();
468+
singleDigitHour = inputArray[0];
469+
singleDigitFound = this.searchColumn(firstColumn, singleDigitHour);
470+
}
471+
472+
// If we found a single-digit hour and have remaining digits,
473+
// use up to 2 of the remaining digits for the second column
474+
if (singleDigitFound && inputArray.length > 1) {
475+
const remainingDigits = inputArray.slice(1, 3).join('');
476+
this.searchColumn(secondColumn, remainingDigits);
477+
}
478+
}
422479
};
423480

424481
private selectMultiColumn = () => {
@@ -433,91 +490,15 @@ export class Picker implements ComponentInterface {
433490
const lastColumn = numericPickers[1];
434491

435492
let value = inputEl.value;
436-
let minuteValue;
437-
switch (value.length) {
438-
case 1:
439-
this.searchColumn(firstColumn, value);
440-
break;
441-
case 2:
442-
/**
443-
* If the first character is `0` or `1` it is
444-
* possible that users are trying to type `09`
445-
* or `11` into the hour field, so we should look
446-
* at that first.
447-
*/
448-
const firstCharacter = inputEl.value.substring(0, 1);
449-
value = firstCharacter === '0' || firstCharacter === '1' ? inputEl.value : firstCharacter;
450-
451-
this.searchColumn(firstColumn, value);
452-
453-
/**
454-
* If only checked the first value,
455-
* we can check the second value
456-
* for a match in the minutes column
457-
*/
458-
if (value.length === 1) {
459-
minuteValue = inputEl.value.substring(inputEl.value.length - 1);
460-
this.searchColumn(lastColumn, minuteValue, 'end');
461-
}
462-
break;
463-
case 3:
464-
/**
465-
* If the first character is `0` or `1` it is
466-
* possible that users are trying to type `09`
467-
* or `11` into the hour field, so we should look
468-
* at that first.
469-
*/
470-
const firstCharacterAgain = inputEl.value.substring(0, 1);
471-
value =
472-
firstCharacterAgain === '0' || firstCharacterAgain === '1'
473-
? inputEl.value.substring(0, 2)
474-
: firstCharacterAgain;
475-
476-
this.searchColumn(firstColumn, value);
477-
478-
/**
479-
* If only checked the first value,
480-
* we can check the second value
481-
* for a match in the minutes column
482-
*/
483-
minuteValue = value.length === 1 ? inputEl.value.substring(1) : inputEl.value.substring(2);
484-
485-
this.searchColumn(lastColumn, minuteValue, 'end');
486-
break;
487-
case 4:
488-
/**
489-
* If the first character is `0` or `1` it is
490-
* possible that users are trying to type `09`
491-
* or `11` into the hour field, so we should look
492-
* at that first.
493-
*/
494-
const firstCharacterAgainAgain = inputEl.value.substring(0, 1);
495-
value =
496-
firstCharacterAgainAgain === '0' || firstCharacterAgainAgain === '1'
497-
? inputEl.value.substring(0, 2)
498-
: firstCharacterAgainAgain;
499-
this.searchColumn(firstColumn, value);
493+
if (value.length > 4) {
494+
const startIndex = inputEl.value.length - 4;
495+
const newString = inputEl.value.substring(startIndex);
500496

501-
/**
502-
* If only checked the first value,
503-
* we can check the second value
504-
* for a match in the minutes column
505-
*/
506-
const minuteValueAgain =
507-
value.length === 1
508-
? inputEl.value.substring(1, inputEl.value.length)
509-
: inputEl.value.substring(2, inputEl.value.length);
510-
this.searchColumn(lastColumn, minuteValueAgain, 'end');
511-
512-
break;
513-
default:
514-
const startIndex = inputEl.value.length - 4;
515-
const newString = inputEl.value.substring(startIndex);
516-
517-
inputEl.value = newString;
518-
this.selectMultiColumn();
519-
break;
497+
inputEl.value = newString;
498+
value = newString;
520499
}
500+
501+
this.multiColumnSearch(firstColumn, lastColumn, value);
521502
};
522503

523504
/**

0 commit comments

Comments
 (0)