cerner / terra-core

Terra offers a set of configurable React components designed to help build scalable and modular application UIs. This UI library was created to solve real-world issues in projects we work on day to day.
http://terra-ui.com
Apache License 2.0
183 stars 165 forks source link

In Firefox, when the hour is entered in the TimeInput, the focus does not automatically move to the minute input #706

Closed benbcai closed 7 years ago

benbcai commented 7 years ago

Issue Description

This issue only occurs in Firefox. The focus does not automatically move to the minute input after entering an hour. This occurs only when the onChange prop is set.

Issue Type

Expected Behavior

When an hour is entered, the focus should automatically move to the minute input.

Current Behavior

In Firefox, the focus does not to the minute input after entering an hour.

Steps to Reproduce

  1. Open Firefox and go to the TimeInput component (http://engineering.cerner.com/terra-core/#/site/time-input)
  2. Go to the "With Default Time" example and clear both the defaulted hour and minute.
  3. Enter an hour (e.g. 10)
  4. The focus should automatically move to the minute input but it does not.

Environment

benbcai commented 7 years ago

The suggested fix for this issue is to move https://github.com/cerner/terra-core/blob/master/packages/terra-time-input/src/TimeInput.jsx#L132 to the end of the handleChange function. Anywhere that calls handleValueChange should pass in event as it is being used in handleValueChange.