dhre-ui-kit 0.0.205 → 0.0.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3968,14 +3968,12 @@ const OTPInput = React__default["default"].forwardRef(
3968
3968
  if (value.length === 1 && regex.test(value) && index >= 0 && index < length) {
3969
3969
  const newOTP = `${otp}${value}`;
3970
3970
  setOTP(newOTP);
3971
- if (index < length - 1) {
3972
- refs.current[index + 1]?.focus();
3973
- }
3971
+ refs.current[index + 1]?.focus();
3974
3972
  } else if (value.length === 0 && index > 0) {
3975
3973
  const newOTP = otp.slice(0, -1);
3976
3974
  setOTP(newOTP);
3977
3975
  refs.current[index - 1]?.focus();
3978
- } else if (value.length === length) {
3976
+ } else if (value?.length === length) {
3979
3977
  setOTP(value);
3980
3978
  refs.current[length - 1]?.focus();
3981
3979
  } else {