Repository: element-plus/element-plus
File: packages/components/time-select/src/time-select.vue (Vue)

Code before:
  return time ? formatTime(time) : null
})

const minTime = computed(() => {
  const time = parseTime(props.minTime || '')
  return time ? formatTime(time) : null
})

const maxTime = computed(() => {
  const time = parseTime(props.maxTime || '')
  return time ? formatTime(time) : null
})

const items = computed(() => {
  const result: { value: string; disabled: boolean }[] = []
  const push = (formattedValue: string, rawValue: string) => {
    result.push({
      value: formattedValue,
      disabled:
        compareTime(rawValue, minTime.value || '-1:-1') <= 0 ||
        compareTime(rawValue, maxTime.value || '100:100') >= 0,
    })
  }

  if (props.start && props.end && props.step) {
    if (step.value === '00:00') {
      debugWarn('ElTimeSelect', 'step should not be 00:00.')
      return result
    }
    let current = start.value
    let currentTime: string
    while (current && end.value && compareTime(current, end.value) <= 0) {
      currentTime = dayjs(current, 'HH:mm')
        .locale(lang.value)
        .format(props.format)
      push(currentTime, current)
      current = nextTime(current, step.value!)
    }
    if (
      props.includeEndTime &&
      end.value &&
      result[result.length - 1]?.value !== end.value
    ) {
      const formattedValue = dayjs(end.value, 'HH:mm')
        .locale(lang.value)
        .format(props.format)
      push(formattedValue, end.value)
    }
  }
  return result
})

Review comment (suggestion):
When I was editing a step in the playground, the page also became unresponsive while typing `00:`. I think this scenario might be excluded as well.

Code after:
  const time = parseTime(props.minTime || '')
  return time ? formatTime(time) : null
})

const maxTime = computed(() => {
  const time = parseTime(props.maxTime || '')
  return time ? formatTime(time) : null
})

const step = computed(() => {
  const time = parseTime(props.step)
  const isInvalidStep =
    !time ||
    time.hours < 0 ||
    time.minutes < 0 ||
    Number.isNaN(time.hours) ||
    Number.isNaN(time.minutes) ||
    (time.hours === 0 && time.minutes === 0)
  if (isInvalidStep) {
    debugWarn(
      'ElTimeSelect',
      `invalid step, fallback to default step (${DEFAULT_STEP}).`
    )
  }
  return !isInvalidStep ? formatTime(time) : DEFAULT_STEP
})

const items = computed(() => {
  const result: { value: string; rawValue: string; disabled: boolean }[] = []
  const push = (formattedValue: string, rawValue: string) => {
    result.push({
      value: formattedValue,
      rawValue,
      disabled:
        compareTime(rawValue, minTime.value || '-1:-1') <= 0 ||
        compareTime(rawValue, maxTime.value || '100:100') >= 0,
    })
  }

  if (props.start && props.end && props.step) {
    let current = start.value
    let currentTime: string
    while (current && end.value && compareTime(current, end.value) <= 0) {
      currentTime = dayjs(current, 'HH:mm')
        .locale(lang.value)
        .format(props.format)
      push(currentTime, current)
      current = nextTime(current, step.value!)
    }
    if (
      props.includeEndTime &&