Repository: ionic-team/ionic-framework
File: core/src/components/picker/picker.tsx (TypeScript)

Code before:
  private searchColumn = (
    colEl: HTMLIonPickerColumnElement,
    value: string,
    zeroBehavior: 'start' | 'end' = 'start'
  ): boolean => {
    if (!value) {
      return false;
    }

    const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
    value = value.replace(behavior, '');
    const option = Array.from(colEl.querySelectorAll('ion-picker-column-option')).find((el) => {
      return el.disabled !== true && el.textContent!.replace(behavior, '') === value;
    });

    if (option) {
      colEl.setValue(option.value);
    }

    return !!option;
  };

  /**
   * Attempts to intelligently search the first and second
   * column as if they're number columns for the provided numbers
   * where the first two numbers inpu are the first column
   * and the last 2 are the last column. Tries to allow for the first
   * number to be ignored for situations where typos occurred.
   */
  private multiColumnSearch = (
    firstColumn: HTMLIonPickerColumnElement,
    secondColumn: HTMLIonPickerColumnElement,
    input: string
  ) => {
    if (input.length === 0) {
      return;
    }

    const inputArray = input.split('');
    const hourValue = inputArray.slice(0, 2).join('');
    const foundHour = this.searchColumn(firstColumn, hourValue);

    if (inputArray.length > 2 && foundHour) {
      const minuteValue = inputArray.slice(2, 4).join('');
      this.searchColumn(secondColumn, minuteValue);
    } else if (!foundHour && inputArray.length >= 1) {
      let singleDigitHour = inputArray[0];
      let singleDigitFound = this.searchColumn(firstColumn, singleDigitHour);
      if (!singleDigitFound) {
        inputArray.shift();
        singleDigitHour = inputArray[0];

Review comment (suggestion):
Do you mean to say?

```suggestion
   * where the first two numbers are the first column
```

Code after:
  private searchColumn = (
    colEl: HTMLIonPickerColumnElement,
    value: string,
    zeroBehavior: 'start' | 'end' = 'start'
  ): boolean => {
    if (!value) {
      return false;
    }

    const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
    value = value.replace(behavior, '');
    const option = Array.from(colEl.querySelectorAll('ion-picker-column-option')).find((el) => {
      return el.disabled !== true && el.textContent!.replace(behavior, '') === value;
    });

    if (option) {
      colEl.setValue(option.value);
    }

    return !!option;
  };

  /**
   * Attempts to intelligently search the first and second
   * column as if they're number columns for the provided numbers
   * where the first two numbers are the first column
   * and the last 2 are the last column. Tries to allow for the first
   * number to be ignored for situations where typos occurred.
   */
  private multiColumnSearch = (
    firstColumn: HTMLIonPickerColumnElement,
    secondColumn: HTMLIonPickerColumnElement,
    input: string
  ) => {
    if (input.length === 0) {
      return;
    }

    const inputArray = input.split('');
    const hourValue = inputArray.slice(0, 2).join('');
    // Try to find a match for the first two digits in the first column
    const foundHour = this.searchColumn(firstColumn, hourValue);

    // If we have more than 2 digits and found a match for hours,
    // use the remaining digits for the second column (minutes)
    if (inputArray.length > 2 && foundHour) {
      const minuteValue = inputArray.slice(2, 4).join('');
      this.searchColumn(secondColumn, minuteValue);
    }
    // If we couldn't find a match for the two-digit hour, try single digit approaches
    else if (!foundHour && inputArray.length >= 1) {